@io-arc/utils
Utility functions and webpack extends.
Usage#
index.ts
Utility Functions#
AssetsDirPath(dir)#
Returns: string
Website assets directory path.
Parameters
| params | type | default | description |
|---|---|---|---|
dir | string[] | - | Directory name array |
example
siteRootRelative(dir)#
Returns: string
Create a relative path from site root.
Site root define is SITE_ROOT.
Parameters
| params | type | default | description |
|---|---|---|---|
dir | string[] | - | Directory name array |
example 1
default.yml
example 2
default.yml
Webpack extends Methods#
Extend build of HTML, CSS, JavaScript.
See settings.
webpack.config.ts
Instance parameters#
| params | type | default | description |
|---|---|---|---|
target | html | css | js | - | Specify a property that exists in webpack.extends.js |
data()#
Returns: object(*) | null
* Return object
Get all information in the specified target.
externals()#
Return: ExternalsElement | ExternalsElement[]
See webpack#externals.
loaders()#
Returns: RuleSetRule[]
See webpack#rule.
plugins()#
Returns: Plugin[]
See webpack#plugins