Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Getmore Workflow: single entry configuration for CSS & JS
module.exports = {
mode: 'development',
entry: {
js: path.resolve('zrc/main.js'),
"css-base": path.resolve('zrc/styles/_bundles/base.css'),
},
stats: 'minimal',
watchOptions: {
ignored: /node_modules/,
},
output: {
path: path.resolve(__dirname, 'assets'),
filename: '[name]-bundle.js',
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
exclude: /(node_modules|zrc\/scripts\/vendors)/,
loader: 'eslint-loader',
options: {
cache: true,
formatter: 'stylish',
},
},
{
test: /\.js$/,
exclude: /(node_modules|zrc\/scripts\/vendors)/,
loader: 'babel-loader',
},
{
test: /\.css$/,
exclude: /node_modules/,
use: [
MiniCssExtractPlugin.loader,
'css-loader?url=false',
'postcss-loader',
],
},
],
},
plugins: [
new FixStyleOnlyEntriesPlugin(),
new MiniCssExtractPlugin({
filename: '[name].liquid',
}),
],
optimization: {
splitChunks: {
chunks: 'all',
minSize: 0,
name: 'js-commons',
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment