8000 build(webpack): build theme assets with webpack 5 · ecomplus/ecomplus.github.io@6ba1371 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ba1371

Browse files
committed
build(webpack): build theme assets with webpack 5
1 parent 2cd4f91 commit 6ba1371

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

webpack.preset-assets.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const path = require('path')
2+
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
3+
4+
module.exports = {
5+
mode: 'production',
6+
entry: './src/assets/index.js',
7+
output: {
8+
filename: 'page.min.js',
9+
path: path.resolve(__dirname, 'src/assets/js')
10+
},
11+
plugins: [
12+
new MiniCssExtractPlugin({
13+
filename: '../css/page.min.css'
14+
})
15+
],
16+
module: {
17+
rules: [
18+
{
19+
test: /\.s[ac]ss$/i,
20+
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
21+
}
22+
]
23+
}
24+
}

0 commit comments

Comments
 (0)
0