-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (34 loc) · 907 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* External dependencies
*/
const path = require( 'path' );
/**
* WordPress dependencies
*/
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
// Sass Loader overrides.
const sassRuleIndex = defaultConfig.module.rules.findIndex(
( rule ) => String( rule.test ) === String( /\.(sc|sa)ss$/ )
);
defaultConfig.module.rules[ sassRuleIndex ].use[ 3 ] = {
loader: require.resolve( 'sass-loader' ),
options: {
sourceMap: defaultConfig.mode !== 'production',
},
};
module.exports = [
{
...defaultConfig,
entry: {
frontend: [
'./wp-content/themes/relicta/assets/js/index.js',
'./wp-content/themes/relicta/assets/sass/style.scss',
],
admin: [ './wp-content/themes/relicta/assets/sass/admin.scss' ],
},
output: {
path: path.resolve( __dirname, './wp-content/themes/relicta/dist' ),
},
plugins: [ ...defaultConfig.plugins.slice( 1 ) ],
},
];