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
Unmaintained
The source for these packages are located in a separate repository Pi-r2. Once per year they are published with each major NodeJS release in April.
@pi-r/html-minifier |
0.7.x |
N |
@pi-r/uglify-js |
0.7.x |
Y [2] |
@pi-r/html-minifier-terser |
0.8.x |
N |
@pi-r/svgo |
0.8.x |
Y [2] |
@pi-r/clean-css |
0.9.x |
N |
@pi-r/csso |
0.9.x |
N |
Tip
Pi-r2 packages are compatible with the latest E-mc and can be used as is without any problems.
Environment Variables
Plugin |
Name |
Value |
|---|---|---|
eslint |
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 |
Pre-Installed
Plugin |
Name |
Alias |
Pi-r |
|---|---|---|---|
postcss |
autoprefixer |
0.10.0 |
|
postcss |
postcss-import |
import |
0.10.0 |
rollup |
@rollup/plugin-commonjs |
commonjs |
0.10.0 |
rollup |
@rollup/plugin-node-resolve |
node-resolve |
0.10.0 |
{
"rollup": {
"bundle-es6": {
"treeshake": true,
"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
]
}
}
}
}