Skip to content

Instantly share code, notes, and snippets.

@UbaldoRosas
Created March 22, 2021 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UbaldoRosas/12506162e3a9b819062fae54bdbf13ae to your computer and use it in GitHub Desktop.
Save UbaldoRosas/12506162e3a9b819062fae54bdbf13ae to your computer and use it in GitHub Desktop.
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