@pixolith/webpack-sw6-config 6.1.5 → 7.0.1
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 +93 -91
- package/src/.postcssrc.js +9 -11
- package/src/babel.config.js +0 -7
- package/src/index.js +1 -1
- package/src/postcss.config.js +20 -0
- package/src/webpack.config.administration.js +27 -63
- package/src/webpack.config.dev.js +34 -54
- package/src/webpack.config.production.js +17 -4
- package/src/webpack.config.storefront.js +27 -40
package/package.json
CHANGED
|
@@ -1,93 +1,95 @@
|
|
|
1
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
2
|
+
"name": "@pixolith/webpack-sw6-config",
|
|
3
|
+
"public": true,
|
|
4
|
+
"version": "7.0.1",
|
|
5
|
+
"description": "",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"scripts": {},
|
|
8
|
+
"files": [
|
|
9
|
+
"src/"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=8.10.0"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/pixolith/webpack-plugins.git"
|
|
17
|
+
},
|
|
18
|
+
"author": "",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/pixolith/webpack-plugins/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/pixolith/webpack-plugins/tree/master/packages/webpack-hook-plugin/#readme",
|
|
24
|
+
"gitHead": "9349ab5ac9d0505c2d15ead9ba9da1eff743e2a7",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@babel/core": "^7.21.3",
|
|
27
|
+
"@babel/eslint-parser": "^7.21.3",
|
|
28
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
29
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
30
|
+
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
|
|
31
|
+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
32
|
+
"@babel/plugin-transform-classes": "^7.21.0",
|
|
33
|
+
"@babel/plugin-transform-runtime": "^7.21.0",
|
|
34
|
+
"@babel/preset-env": "^7.20.2",
|
|
35
|
+
"@pixolith/eslint-config-sw6": "^7.0.0",
|
|
36
|
+
"@pixolith/external-svg-sprite-loader": "^6.0.1",
|
|
37
|
+
"@pixolith/stylelint-config-standard": "^7.0.0",
|
|
38
|
+
"@pixolith/webpack-assets-copy-plugin": "^7.0.0",
|
|
39
|
+
"@pixolith/webpack-filename-linter-plugin": "^7.0.0",
|
|
40
|
+
"@pixolith/webpack-hook-plugin": "^7.0.0",
|
|
41
|
+
"@pixolith/webpack-twig-assets-emitter-plugin": "^7.0.0",
|
|
42
|
+
"@pixolith/webpack-watcher": "^7.0.0",
|
|
43
|
+
"autoprefixer": "^10.4.14",
|
|
44
|
+
"babel-loader": "^9.1.2",
|
|
45
|
+
"change-case": "^4.1.2",
|
|
46
|
+
"chokidar": "^3.5.3",
|
|
47
|
+
"concurrently": "^7.6.0",
|
|
48
|
+
"consola": "^2.15.3",
|
|
49
|
+
"core-js": "^3.29.1",
|
|
50
|
+
"cross-env": "^7.0.3",
|
|
51
|
+
"css-loader": "^6.7.3",
|
|
52
|
+
"css-minimizer-webpack-plugin": "^4.2.2",
|
|
53
|
+
"deepmerge": "^4.3.0",
|
|
54
|
+
"eslint": "^8.36.0",
|
|
55
|
+
"eslint-friendly-formatter": "^4.0.1",
|
|
56
|
+
"eslint-plugin-filenames": "^1.3.2",
|
|
57
|
+
"eslint-plugin-spellcheck": "0.0.20",
|
|
58
|
+
"eslint-webpack-plugin": "^4.0.0",
|
|
59
|
+
"execa": "^7.1.1",
|
|
60
|
+
"external-svg-sprite-loader": "^7.2.0",
|
|
61
|
+
"extract-css-chunks-webpack-plugin": "^4.9.0",
|
|
62
|
+
"file-loader": "^6.2.0",
|
|
63
|
+
"glob": "^9.3.0",
|
|
64
|
+
"html-loader": "^4.2.0",
|
|
65
|
+
"media-query-plugin": "^1.5.0",
|
|
66
|
+
"postcss": "^8.4.21",
|
|
67
|
+
"postcss-loader": "^7.0.2",
|
|
68
|
+
"postcss-scss": "^4.0.6",
|
|
69
|
+
"prettier": "^2.8.4",
|
|
70
|
+
"rimraf": "^4.4.0",
|
|
71
|
+
"sass": "^1.59.3",
|
|
72
|
+
"sass-loader": "^13.2.0",
|
|
73
|
+
"sass-resources-loader": "^2.2.5",
|
|
74
|
+
"string-replace-loader": "^3.1.0",
|
|
75
|
+
"style-loader": "^3.3.2",
|
|
76
|
+
"stylelint": "^15.2.0",
|
|
77
|
+
"stylelint-config-standard": "^30.0.1",
|
|
78
|
+
"stylelint-config-standard-scss": "^7.0.1",
|
|
79
|
+
"stylelint-prettier": "^3.0.0",
|
|
80
|
+
"stylelint-webpack-plugin": "^4.1.0",
|
|
81
|
+
"svg-sprite-loader": "^6.0.11",
|
|
82
|
+
"svg-transform-loader": "^2.0.13",
|
|
83
|
+
"svgo-loader": "^4.0.0",
|
|
84
|
+
"terser-webpack-plugin": "^5.3.7",
|
|
85
|
+
"time-fix-plugin": "^2.0.7",
|
|
86
|
+
"url-loader": "^4.1.1",
|
|
87
|
+
"webpack": "^5.76.1",
|
|
88
|
+
"webpack-cli": "^5.0.1",
|
|
89
|
+
"webpack-dev-server": "^4.12.0",
|
|
90
|
+
"webpack-glob-entry": "^2.1.1",
|
|
91
|
+
"webpack-merge": "^5.8.0",
|
|
92
|
+
"webpackbar": "^5.0.2",
|
|
93
|
+
"write-file-webpack-plugin": "^4.5.1"
|
|
94
|
+
}
|
|
93
95
|
}
|
package/src/.postcssrc.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
module.exports = ({ file, options, env }) => {
|
|
2
2
|
return {
|
|
3
|
+
minimizerOptions: {
|
|
4
|
+
preset: [
|
|
5
|
+
'default',
|
|
6
|
+
{
|
|
7
|
+
discardComments: { removeAll: true },
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
zindex: false,
|
|
11
|
+
},
|
|
3
12
|
plugins: {
|
|
4
13
|
// to edit target browsers: use "browserslist" field in package.json
|
|
5
14
|
autoprefixer: {
|
|
6
15
|
grid: true,
|
|
7
16
|
env: options.mode + (options.isModern ? ':modern' : ''),
|
|
8
17
|
},
|
|
9
|
-
cssnano: {
|
|
10
|
-
preset: [
|
|
11
|
-
'default',
|
|
12
|
-
{
|
|
13
|
-
discardComments: {
|
|
14
|
-
removeAll: true,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
zindex: false,
|
|
19
|
-
},
|
|
20
18
|
},
|
|
21
19
|
};
|
|
22
20
|
};
|
package/src/babel.config.js
CHANGED
|
@@ -7,13 +7,6 @@ module.exports = {
|
|
|
7
7
|
corejs: 3,
|
|
8
8
|
debug: false,
|
|
9
9
|
useBuiltIns: 'usage',
|
|
10
|
-
targets: {
|
|
11
|
-
browsers: require(process.cwd() + '/package.json')
|
|
12
|
-
.browserslist[
|
|
13
|
-
process.env.SHOPWARE_MODE +
|
|
14
|
-
(process.env.MODE ? ':modern' : '')
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
10
|
},
|
|
18
11
|
],
|
|
19
12
|
],
|
package/src/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const isProd = process.env.NODE_ENV === 'production';
|
|
|
6
6
|
const pkg = require('./../package.json');
|
|
7
7
|
const isModern = process.env.MODE === 'modern';
|
|
8
8
|
const watcher = require('@pixolith/webpack-watcher');
|
|
9
|
-
const merge = require('webpack-merge');
|
|
9
|
+
const { merge } = require('webpack-merge');
|
|
10
10
|
const Consola = require('consola');
|
|
11
11
|
|
|
12
12
|
const setup = () => {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = ({ file, options, env }) => {
|
|
2
|
+
return {
|
|
3
|
+
minimizerOptions: {
|
|
4
|
+
preset: [
|
|
5
|
+
'default',
|
|
6
|
+
{
|
|
7
|
+
discardComments: { removeAll: true },
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
zindex: false,
|
|
11
|
+
},
|
|
12
|
+
plugins: {
|
|
13
|
+
// to edit target browsers: use "browserslist" field in package.json
|
|
14
|
+
//autoprefixer: {
|
|
15
|
+
// grid: true,
|
|
16
|
+
// env: options.mode + (options.isModern ? ':modern' : ''),
|
|
17
|
+
//},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -5,14 +5,11 @@ const Path = require('path'),
|
|
|
5
5
|
entry = require('webpack-glob-entry'),
|
|
6
6
|
publicPath = process.env.PUBLIC_PATH,
|
|
7
7
|
spritePath = process.env.SPRITE_PATH ?? 'custom/plugins/PxswTheme/src/Resources/views/administration',
|
|
8
|
-
swNodePath = process.env.SW_NODE_PATH ?? 'vendor/shopware/administration/Resources/app/administration/src',
|
|
9
|
-
swAliasPath = process.env.SW_ALIAS_PATH ?? 'vendor/shopware/administration/Resources/app/administration/src',
|
|
10
8
|
ExtractCssChunks = require('extract-css-chunks-webpack-plugin'),
|
|
11
9
|
AssetsCopyPlugin = require('@pixolith/webpack-assets-copy-plugin'),
|
|
12
10
|
isProd = process.env.NODE_ENV === 'production',
|
|
13
11
|
SvgStorePlugin = require('@pixolith/external-svg-sprite-loader'),
|
|
14
12
|
HookPlugin = require('@pixolith/webpack-hook-plugin'),
|
|
15
|
-
//isModern = process.env.MODE === 'modern',
|
|
16
13
|
outputPath = Path.resolve(process.cwd(), publicPath),
|
|
17
14
|
outputConfig = {
|
|
18
15
|
path: outputPath,
|
|
@@ -50,26 +47,6 @@ module.exports = {
|
|
|
50
47
|
|
|
51
48
|
return { ...entriesPlugins };
|
|
52
49
|
},
|
|
53
|
-
performance: {
|
|
54
|
-
maxEntrypointSize: 300000,
|
|
55
|
-
hints: false,
|
|
56
|
-
},
|
|
57
|
-
resolve: {
|
|
58
|
-
modules: [
|
|
59
|
-
'node_modules',
|
|
60
|
-
Path.resolve(privatePath, 'js'),
|
|
61
|
-
Path.resolve(
|
|
62
|
-
process.cwd(),
|
|
63
|
-
swNodePath,
|
|
64
|
-
),
|
|
65
|
-
],
|
|
66
|
-
alias: {
|
|
67
|
-
src: Path.join(
|
|
68
|
-
process.cwd(),
|
|
69
|
-
swAliasPath,
|
|
70
|
-
),
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
50
|
module: {
|
|
74
51
|
// loader order is from right to left or from bottom to top depending on the notation but basicly always reverse
|
|
75
52
|
rules: [
|
|
@@ -82,28 +59,18 @@ module.exports = {
|
|
|
82
59
|
},
|
|
83
60
|
},
|
|
84
61
|
{
|
|
85
|
-
test: /\.png
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
limit: 100000,
|
|
91
|
-
outputPath: '../images',
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
],
|
|
62
|
+
test: /\.(jpe?g|png|gif|ico)(\?v=\d+\.\d+\.\d+)?$/,
|
|
63
|
+
type: 'asset/resource',
|
|
64
|
+
generator: {
|
|
65
|
+
filename: '../img/[name][ext]'
|
|
66
|
+
}
|
|
95
67
|
},
|
|
96
68
|
{
|
|
97
|
-
test:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
outputPath: '../fonts',
|
|
103
|
-
name: '[name].[ext]',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
],
|
|
69
|
+
test: /\.(eot|ttf|woff2?)(\?v=\d+\.\d+\.\d+)?$/,
|
|
70
|
+
type: 'asset/resource',
|
|
71
|
+
generator: {
|
|
72
|
+
filename: '../fonts/[name][ext]'
|
|
73
|
+
}
|
|
107
74
|
},
|
|
108
75
|
{
|
|
109
76
|
test: /\.svg$/,
|
|
@@ -120,26 +87,23 @@ module.exports = {
|
|
|
120
87
|
loader: 'svgo-loader',
|
|
121
88
|
options: {
|
|
122
89
|
plugins: [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
{ removeComments: true },
|
|
141
|
-
{ removeEditorsNSData: true },
|
|
142
|
-
{ removeUnknownsAndDefaults: true },
|
|
90
|
+
'cleanupAttrs',
|
|
91
|
+
'removeDoctype',
|
|
92
|
+
'removeXMLProcInst',
|
|
93
|
+
'cleanupEnableBackground',
|
|
94
|
+
'convertStyleToAttrs',
|
|
95
|
+
'convertPathData',
|
|
96
|
+
'cleanupIds',
|
|
97
|
+
'minifyStyles',
|
|
98
|
+
'removeUselessDefs',
|
|
99
|
+
'convertShapeToPath',
|
|
100
|
+
'removeUnusedNS',
|
|
101
|
+
'removeDimensions',
|
|
102
|
+
'convertTransform',
|
|
103
|
+
'collapseGroups',
|
|
104
|
+
'removeComments',
|
|
105
|
+
'removeEditorsNSData',
|
|
106
|
+
'removeUnknownsAndDefaults',
|
|
143
107
|
],
|
|
144
108
|
},
|
|
145
109
|
},
|
|
@@ -3,15 +3,15 @@ const webpack = require('webpack'),
|
|
|
3
3
|
Consola = require('consola'),
|
|
4
4
|
fs = require('fs'),
|
|
5
5
|
ASSET_URL = process.env.ASSET_URL || '/',
|
|
6
|
-
OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'),
|
|
7
6
|
StyleLintPlugin = require('stylelint-webpack-plugin'),
|
|
8
7
|
isProd = process.env.NODE_ENV === 'production',
|
|
9
8
|
privatePath = process.env.PLUGIN_PATH,
|
|
10
9
|
ExtractCssChunks = require('extract-css-chunks-webpack-plugin'),
|
|
10
|
+
//MediaQueryPlugin = require('media-query-plugin'),
|
|
11
11
|
FilenameLinterPlugin = require('@pixolith/webpack-filename-linter-plugin'),
|
|
12
|
+
ESLintPlugin = require('eslint-webpack-plugin'),
|
|
12
13
|
watcher = require('@pixolith/webpack-watcher'),
|
|
13
14
|
Glob = require('glob'),
|
|
14
|
-
isModern = process.env.MODE === 'modern',
|
|
15
15
|
HookPlugin = require('@pixolith/webpack-hook-plugin'),
|
|
16
16
|
sass = require('sass'),
|
|
17
17
|
TimeFixPlugin = require('time-fix-plugin');
|
|
@@ -38,16 +38,6 @@ module.exports = {
|
|
|
38
38
|
module: {
|
|
39
39
|
// loader order is from right to left or from bottom to top depending on the notation but basicly always reverse
|
|
40
40
|
rules: [
|
|
41
|
-
{
|
|
42
|
-
enforce: 'pre',
|
|
43
|
-
test: /\.js$/,
|
|
44
|
-
loader: 'eslint-loader',
|
|
45
|
-
exclude: (file) => /node_modules/.test(file),
|
|
46
|
-
options: {
|
|
47
|
-
formatter: require('eslint-friendly-formatter'),
|
|
48
|
-
configFile: Path.resolve(__dirname, '.eslintrc.js'),
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
41
|
{
|
|
52
42
|
test: /(\.scss|\.css)$/,
|
|
53
43
|
use: [
|
|
@@ -59,16 +49,15 @@ module.exports = {
|
|
|
59
49
|
sourceMap: !isProd,
|
|
60
50
|
},
|
|
61
51
|
},
|
|
52
|
+
//{
|
|
53
|
+
// loader: MediaQueryPlugin.loader
|
|
54
|
+
//},
|
|
62
55
|
{
|
|
63
56
|
loader: 'postcss-loader',
|
|
64
57
|
options: {
|
|
65
58
|
sourceMap: !isProd,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
ctx: {
|
|
69
|
-
mode: process.env.SHOPWARE_MODE,
|
|
70
|
-
isModern: isModern,
|
|
71
|
-
},
|
|
59
|
+
postcssOptions: {
|
|
60
|
+
config: Path.resolve(__dirname, 'postcss.config.js'),
|
|
72
61
|
},
|
|
73
62
|
},
|
|
74
63
|
},
|
|
@@ -91,6 +80,7 @@ module.exports = {
|
|
|
91
80
|
).filter((path) => {
|
|
92
81
|
return Glob.sync(path).length > 0;
|
|
93
82
|
}),
|
|
83
|
+
hoistUseStatements: true
|
|
94
84
|
},
|
|
95
85
|
},
|
|
96
86
|
],
|
|
@@ -103,29 +93,18 @@ module.exports = {
|
|
|
103
93
|
},
|
|
104
94
|
],
|
|
105
95
|
},
|
|
106
|
-
{
|
|
107
|
-
test: /\.js$/,
|
|
108
|
-
loader: 'string-replace-loader',
|
|
109
|
-
options: {
|
|
110
|
-
search:
|
|
111
|
-
"import PluginManager from 'src/plugin-system/plugin.manager'",
|
|
112
|
-
//match, p1, offset, string
|
|
113
|
-
replace: () => 'const PluginManager = window.PluginManager',
|
|
114
|
-
flags: 'g',
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
96
|
],
|
|
118
97
|
},
|
|
98
|
+
stats: 'errors-warnings',
|
|
119
99
|
devServer: {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
100
|
+
allowedHosts: 'all',
|
|
101
|
+
client: {
|
|
102
|
+
webSocketURL: 'https://node.px-staging.de:8080',
|
|
103
|
+
overlay: {
|
|
104
|
+
warnings: false,
|
|
105
|
+
errors: true,
|
|
106
|
+
},
|
|
127
107
|
},
|
|
128
|
-
writeToDisk: true,
|
|
129
108
|
headers: {
|
|
130
109
|
'Access-Control-Allow-Origin': '*',
|
|
131
110
|
'Access-Control-Allow-Methods':
|
|
@@ -133,7 +112,6 @@ module.exports = {
|
|
|
133
112
|
'Access-Control-Allow-Headers':
|
|
134
113
|
'X-Requested-With, content-type, Authorization',
|
|
135
114
|
},
|
|
136
|
-
stats: 'errors-warnings',
|
|
137
115
|
https: !isProd
|
|
138
116
|
? {
|
|
139
117
|
ca: fs.readFileSync(
|
|
@@ -156,7 +134,7 @@ module.exports = {
|
|
|
156
134
|
),
|
|
157
135
|
}
|
|
158
136
|
: false,
|
|
159
|
-
|
|
137
|
+
onAfterSetupMiddleware: function(devServer) {
|
|
160
138
|
if (!isProd) {
|
|
161
139
|
Consola.success(
|
|
162
140
|
`Starting webpack in [${process.env.NODE_ENV}] with [${process.env.SHOPWARE_MODE}]`,
|
|
@@ -166,6 +144,12 @@ module.exports = {
|
|
|
166
144
|
},
|
|
167
145
|
},
|
|
168
146
|
plugins: [
|
|
147
|
+
new ESLintPlugin({
|
|
148
|
+
exclude: [
|
|
149
|
+
'node_modules',
|
|
150
|
+
'vendor'
|
|
151
|
+
]
|
|
152
|
+
}),
|
|
169
153
|
new HookPlugin({
|
|
170
154
|
beforeCompile(compiler, callback) {
|
|
171
155
|
let path = Path.join(process.cwd(), 'public/sprite'),
|
|
@@ -191,7 +175,7 @@ module.exports = {
|
|
|
191
175
|
}),
|
|
192
176
|
|
|
193
177
|
new FilenameLinterPlugin({
|
|
194
|
-
ignoreFiles: [/node_modules/, /custom\/apps/, /vendor
|
|
178
|
+
ignoreFiles: [/node_modules/, /custom\/apps/, /vendor/],
|
|
195
179
|
rules: {
|
|
196
180
|
// check cases here https://github.com/blakeembrey/change-case
|
|
197
181
|
scss: 'paramCase',
|
|
@@ -211,19 +195,16 @@ module.exports = {
|
|
|
211
195
|
'process.env.ASSET_URL': JSON.stringify(ASSET_URL),
|
|
212
196
|
}),
|
|
213
197
|
|
|
214
|
-
new
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
],
|
|
225
|
-
},
|
|
226
|
-
}),
|
|
198
|
+
//new MediaQueryPlugin({
|
|
199
|
+
// include: [
|
|
200
|
+
// 'example'
|
|
201
|
+
// ],
|
|
202
|
+
// queries: {
|
|
203
|
+
// '@media(min-width:768px)': 'desktop',
|
|
204
|
+
// '@media(min-width:1024px)': 'desktop',
|
|
205
|
+
// '@media(min-width:1280px)': 'desktop',
|
|
206
|
+
// }
|
|
207
|
+
//}),
|
|
227
208
|
].concat(
|
|
228
209
|
Glob.sync(Path.join(privatePath, '/**/*.s?(a|c)ss')).length
|
|
229
210
|
? new StyleLintPlugin({
|
|
@@ -235,5 +216,4 @@ module.exports = {
|
|
|
235
216
|
: [],
|
|
236
217
|
),
|
|
237
218
|
watch: false,
|
|
238
|
-
stats: 'errors-warnings',
|
|
239
219
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const webpack = require('webpack'),
|
|
2
2
|
TerserPlugin = require('terser-webpack-plugin'),
|
|
3
|
+
CssMinimizerPlugin = require('css-minimizer-webpack-plugin'),
|
|
3
4
|
isModern = process.env.MODE === 'modern',
|
|
4
5
|
config = {
|
|
5
|
-
devtool: '
|
|
6
|
+
devtool: 'nosources-source-map',
|
|
6
7
|
performance: {
|
|
7
8
|
maxEntrypointSize: 300000,
|
|
8
9
|
maxAssetSize: 250000,
|
|
@@ -11,19 +12,30 @@ const webpack = require('webpack'),
|
|
|
11
12
|
mode: 'production',
|
|
12
13
|
optimization: {
|
|
13
14
|
concatenateModules: true,
|
|
14
|
-
namedModules: false,
|
|
15
15
|
removeAvailableModules: true,
|
|
16
16
|
removeEmptyChunks: true,
|
|
17
17
|
sideEffects: false,
|
|
18
18
|
minimizer: [
|
|
19
|
+
new CssMinimizerPlugin({
|
|
20
|
+
minimizerOptions: {
|
|
21
|
+
preset: [
|
|
22
|
+
"default",
|
|
23
|
+
{
|
|
24
|
+
discardComments: { removeAll: true },
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
minify: [
|
|
29
|
+
CssMinimizerPlugin.cssnanoMinify,
|
|
30
|
+
]
|
|
31
|
+
}),
|
|
19
32
|
new TerserPlugin({
|
|
20
33
|
terserOptions: {
|
|
21
|
-
extractComments: false,
|
|
22
34
|
compress: {
|
|
23
35
|
drop_console: true,
|
|
24
36
|
},
|
|
25
37
|
mangle: true,
|
|
26
|
-
ecma: isModern ?
|
|
38
|
+
ecma: isModern ? 8 : 5,
|
|
27
39
|
keep_classnames: false,
|
|
28
40
|
keep_fnames: false,
|
|
29
41
|
ie8: false,
|
|
@@ -33,6 +45,7 @@ const webpack = require('webpack'),
|
|
|
33
45
|
toplevel: false,
|
|
34
46
|
warnings: false,
|
|
35
47
|
},
|
|
48
|
+
extractComments: false,
|
|
36
49
|
}),
|
|
37
50
|
],
|
|
38
51
|
},
|
|
@@ -113,28 +113,18 @@ module.exports = {
|
|
|
113
113
|
],
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
|
-
test: /\.png
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
limit: 100000,
|
|
122
|
-
outputPath: 'images',
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
],
|
|
116
|
+
test: /\.(jpe?g|png|gif|ico)(\?v=\d+\.\d+\.\d+)?$/,
|
|
117
|
+
type: 'asset/resource',
|
|
118
|
+
generator: {
|
|
119
|
+
filename: 'img/[name][ext]'
|
|
120
|
+
}
|
|
126
121
|
},
|
|
127
122
|
{
|
|
128
|
-
test:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
outputPath: 'fonts',
|
|
134
|
-
name: '[name].[ext]',
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
],
|
|
123
|
+
test: /\.(eot|ttf|woff2?)(\?v=\d+\.\d+\.\d+)?$/,
|
|
124
|
+
type: 'asset/resource',
|
|
125
|
+
generator: {
|
|
126
|
+
filename: 'fonts/[name][ext]'
|
|
127
|
+
}
|
|
138
128
|
},
|
|
139
129
|
{
|
|
140
130
|
test: /\.svg$/,
|
|
@@ -151,26 +141,23 @@ module.exports = {
|
|
|
151
141
|
loader: 'svgo-loader',
|
|
152
142
|
options: {
|
|
153
143
|
plugins: [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
{ removeComments: true },
|
|
172
|
-
{ removeEditorsNSData: true },
|
|
173
|
-
{ removeUnknownsAndDefaults: true },
|
|
144
|
+
'cleanupAttrs',
|
|
145
|
+
'removeDoctype',
|
|
146
|
+
'removeXMLProcInst',
|
|
147
|
+
'cleanupEnableBackground',
|
|
148
|
+
'convertStyleToAttrs',
|
|
149
|
+
'convertPathData',
|
|
150
|
+
'cleanupIds',
|
|
151
|
+
'minifyStyles',
|
|
152
|
+
'removeUselessDefs',
|
|
153
|
+
'convertShapeToPath',
|
|
154
|
+
'removeUnusedNS',
|
|
155
|
+
'removeDimensions',
|
|
156
|
+
'convertTransform',
|
|
157
|
+
'collapseGroups',
|
|
158
|
+
'removeComments',
|
|
159
|
+
'removeEditorsNSData',
|
|
160
|
+
'removeUnknownsAndDefaults',
|
|
174
161
|
],
|
|
175
162
|
},
|
|
176
163
|
},
|