Built-In
JS and CSS files can be optimized further using these settings:
compile
bundle[-es6]
lint
es5
transform
beautify
minify
es5-minify
custom name
You can define or undefine your own optimizations in squared.json.
HTML
@pi-r/posthtml |
5 |
|
@pi-r/prettier |
6 |
|
@pi-r/html-validate |
3 |
CSS
@pi-r/postcss |
5 |
|
@pi-r/stylelint |
3 |
|
@pi-r/sass |
1 |
JS
@pi-r/babel |
4 |
|
@pi-r/eslint |
3 |
|
@pi-r/prettier |
6 |
|
@pi-r/rollup |
2 |
|
@pi-r/terser |
7 |
These plugins can be configured using a plain object in settings.transform. Import maps [1] are available for plugins which resolve imports through the file system. Other non-builtin transpilers can similarly be integrated by defining a custom function.
NPM custom package
Local file using module.exports (e.g. “.cjs”)
Local file using export default (e.g. “.mjs”)
Local plain file with single function (e.g. “.js”)
Inline function
Environment Variables
Plugin |
Name |
Value |
|---|---|---|
eslint [2] |
ESLINT_USE_FLAT_CONFIG |
boolean |
eslint |
ESLINT_FORMATTER_NAME |
any |
sass [3] |
SASS_OPTIONS_IMPORTER_NODE_PACKAGE |
path/boolean |
stylelint |
STYLELINT_OPTIONS_CWD |
path |
stylelint |
STYLELINT_OPTIONS_CONFIG_FILE |
path |
stylelint |
STYLELINT_OPTIONS_CONFIG_BASEDIR |
path |
stylelint |
STYLELINT_OPTIONS_VALIDATE |
boolean |
stylelint |
STYLELINT_OPTIONS_FIX |
boolean |
stylelint |
STYLELINT_OPTIONS_FORMATTER |
string |
prettier |
PRETTIER_OPTIONS_CONFIG |
path/boolean |
Pre-Installed
Plugin |
Name |
Alias |
Pi-r |
|---|---|---|---|
postcss |
autoprefixer |
0.10 |
|
postcss |
postcss-import |
import |
0.10 |
rollup |
@rollup/plugin-commonjs |
commonjs |
0.10 |
rollup |
@rollup/plugin-node-resolve |
node-resolve |
0.10 |
{
"rollup": {
"bundle-es6": {
"treeshake": true,
"external": "/\\.js$/", // String with /[^|$]/ is parsed as a RegExp
"plugins": [
"node-resolve",
"@rollup/plugin-commonjs", // "commonjs"
["babel", { "__default__": "babel", "babelHelpers": "bundled" }] // __default__ (@pi-r property)
],
"output": {
"format": "es",
"preserveModules": false,
"sourcemap": true,
"plugins": [
["@rollup/plugin-terser", { "keep_classnames": true }] // npm i @rollup/plugin-terser
]
}
}
}
}