@sumotto/configs 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const MiniCSSExtractPlugin = require( 'mini-css-extract-plugin' );
|
|
2
2
|
const RtlCssPlugin = require( 'rtlcss-webpack-plugin' );
|
|
3
3
|
const { CleanWebpackPlugin } = require( 'clean-webpack-plugin' );
|
|
4
|
+
const RemoveEmptyScriptsPlugin = require( 'webpack-remove-empty-scripts' );
|
|
4
5
|
const {
|
|
5
6
|
Config,
|
|
6
7
|
defaultConfigWP,
|
|
@@ -12,7 +13,8 @@ const defaultConfig = new Config(
|
|
|
12
13
|
'default',
|
|
13
14
|
process.env.THEME_BLOCK_DEV_SERVER_PORT || 'auto'
|
|
14
15
|
)
|
|
15
|
-
.addEntries( 'src/**/styles/*.{pc,sc,sa,c}ss' )
|
|
16
|
+
.addEntries( 'src/blocks/**/styles/*.{pc,sc,sa,c}ss' )
|
|
17
|
+
.addEntries( 'src/index.{ts,tsx}' )
|
|
16
18
|
.removePlugin( RtlCssPlugin )
|
|
17
19
|
.replacePlugin(
|
|
18
20
|
new MiniCSSExtractPlugin( {
|
|
@@ -26,10 +28,16 @@ const defaultConfig = new Config(
|
|
|
26
28
|
)
|
|
27
29
|
.addPlugin(
|
|
28
30
|
new CleanWebpackPlugin( {
|
|
29
|
-
cleanOnceBeforeBuildPatterns: [ '!**/*module*,' ],
|
|
31
|
+
cleanOnceBeforeBuildPatterns: [ '**/*', '!**/*module*,' ],
|
|
30
32
|
cleanStaleWebpackAssets: false,
|
|
31
33
|
} ),
|
|
32
34
|
'before'
|
|
35
|
+
)
|
|
36
|
+
.addPlugin(
|
|
37
|
+
// For styles remove JS and styles .asset.php
|
|
38
|
+
new RemoveEmptyScriptsPlugin( {
|
|
39
|
+
enabled: ! Config.hasDevServer( defaultConfigWP ),
|
|
40
|
+
} )
|
|
33
41
|
);
|
|
34
42
|
|
|
35
43
|
const modulesConfig = new Config( modulesConfigWP, 'modules' );
|
|
@@ -31,7 +31,7 @@ const defaultConfig = new Config(
|
|
|
31
31
|
.removePlugin( RtlCssPlugin )
|
|
32
32
|
.addPlugin(
|
|
33
33
|
new CleanWebpackPlugin( {
|
|
34
|
-
cleanOnceBeforeBuildPatterns: [ '!modules/**' ],
|
|
34
|
+
cleanOnceBeforeBuildPatterns: [ '**/*', '!modules/**' ],
|
|
35
35
|
cleanStaleWebpackAssets: false,
|
|
36
36
|
} ),
|
|
37
37
|
'before'
|