asset-conjurer
v1.4.14
Published
Example:
Downloads
397
Readme
asset-conjurer
Example:
buildAssets({
watch: true,
afterBuild: () => {
// after build js
},
js: {
pathIn: 'src/js',
pathOut: 'www/assets/js',
pathHash: 'tmp/hash',
name: 'main',
bundler: 'esbuild', // or 'webpack'
esbuildFormat: 'module', // https://esbuild.github.io/api/#format
sourcemap: true, // generate or not sourcemap
webpackTarget: 'es2020', // https://webpack.js.org/configuration/target/
webpackOutputChunkFormat: 'esm', // https://webpack.js.org/configuration/output/#outputchunkformat
watches: ['../common/js'] // additional folders to watch
},
scss: {
pathIn: 'src/scss',
pathOut: 'www/assets/css',
name: '1-basic',
afterBuild: ({ result }) => result.css, // fn after build
watches: [`src/another-scss`] // additional folders to watch
},
absolutePath: __dirname
});
Breaking change on 1.4.x: asset copy has been removed, watches only admits routes without glob queries.