@xazure/builder-theme v0.1.0
Xazure Builder - Theme
Builds Xazure packages which specify a type of module and conform to the required structure
Built Project Structure
Expects there to be a directory named src. It must include an index.js directly inside.
Optionally, there may be a public directory in src.
- src
- index.js
- public
Any other files may appear anywhere. Files are output to the dist folder and this will be cleaned
before each built (i.e., don't put files in here directly).
Build Process
- Any
.jsfiles will not inpublicwill be built with Babel, withmodules: true. - Any
.jsfiles insidepublicwill be built with Babel, withmodules: false. - Any
index.cssfiles anywhere withinpublicwill be built with PostCSS.- Note: This means any non-
index.cssfiles should be imported by one of theindex.cssfiles.
- Note: This means any non-
Any other files will be copied over as is.
Built files will be output to dist.
Directory structure for all files (except skipped CSS files) will be maintained and mirrored.
Babel Plugins and Presets
The following plugins are included by default:
env
For public files, modules: false is set. For non-public files, it is left default (modules: true).
The following presets are included by default:
transform-object-rest-spread
For public, import-rename is also added and configured so it'll auto-append .js when appropriate.
PostCSS Plugins
The following plugins are included:
- cssnext
- import
nested
You can define (or disable) plugins in the configuration.
Configuration
The following configuration can be defined under the xazure key in package.json or in a
xazure.config.js file:
{
"type": "module",
"postCss": {
"plugins": [],
"disable": []
},
"babel": {
"private": {
"plugins": [],
"presets": [],
"disablePlugins": [],
"disablePresets": []
},
"public": {
"plugins": [],
"presets": [],
"disablePlugins": [],
"disablePresets": []
}
}
}type- While not used by the builder itself, if provided a configuration, needed to direct it to this builder.postcss.plugins- Provide additional plugins forPostCSS. Provide them just as you would in apostcss.config.jsfile.postcss.disable- Disable one of the predefined plugins listed in the PostCSS Plugins section.babel.public- Configuration for the public JS files..plugins- Plugins to add, same as.babelrc. Provide a default one to override options..presets- Presets to add, same as.babelrc. Provide a default one to override options..disablePlugins- Plugins to remove from defaults. See Babel Plugins and Presets..disablePresets- Presets to remove from defaults. See Babel Plugins and Presets.
babel.private- Configuration for the non-public JS files..plugins- Plugins to add, same as.babelrc. Provide a default one to override options..presets- Presets to add, same as.babelrc. Provide a default one to override options..disablePlugins- Plugins to remove from defaults. See Babel Plugins and Presets..disablePresets- Presets to remove from defaults. See Babel Plugins and Presets.
8 years ago