Created
March 22, 2021 19:29
-
-
Save UbaldoRosas/12506162e3a9b819062fae54bdbf13ae to your computer and use it in GitHub Desktop.
Getmore Workflow: single entry configuration for CSS & JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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