@lightscale/webpack-config 1.0.6 → 1.2.0
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/index.js +3 -46
- package/package.json +16 -9
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
2
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
3
|
+
import RemoveEmptyScriptsPlugin from 'webpack-remove-empty-scripts';
|
|
3
4
|
import NotifierPlugin from 'webpack-notifier';
|
|
4
5
|
import ManifestPlugin from 'webpack-assets-manifest';
|
|
5
6
|
import StylelintPlugin from 'stylelint-webpack-plugin';
|
|
@@ -44,51 +45,6 @@ const postCssConfig = {
|
|
|
44
45
|
]
|
|
45
46
|
};
|
|
46
47
|
|
|
47
|
-
const esLintConfig = {
|
|
48
|
-
'root': true,
|
|
49
|
-
'extends': [
|
|
50
|
-
'eslint:recommended'
|
|
51
|
-
],
|
|
52
|
-
'globals': {
|
|
53
|
-
'wp': true,
|
|
54
|
-
},
|
|
55
|
-
'env': {
|
|
56
|
-
'node': true,
|
|
57
|
-
'es6': true,
|
|
58
|
-
'amd': true,
|
|
59
|
-
'browser': true,
|
|
60
|
-
'jquery': true,
|
|
61
|
-
},
|
|
62
|
-
'parser': '@babel/eslint-parser',
|
|
63
|
-
'parserOptions': {
|
|
64
|
-
'ecmaFeatures': {
|
|
65
|
-
'globalReturn': true,
|
|
66
|
-
'generators': false,
|
|
67
|
-
'objectLiteralDuplicateProperties': false,
|
|
68
|
-
'experimentalObjectRestSpread': true,
|
|
69
|
-
},
|
|
70
|
-
'ecmaVersion': 2017,
|
|
71
|
-
'sourceType': 'module',
|
|
72
|
-
'requireConfigFile': false,
|
|
73
|
-
},
|
|
74
|
-
'plugins': [
|
|
75
|
-
|
|
76
|
-
],
|
|
77
|
-
'settings': {
|
|
78
|
-
'import/core-modules': [],
|
|
79
|
-
'import/ignore': [
|
|
80
|
-
'node_modules',
|
|
81
|
-
'\\.(coffee|scss|css|less|hbs|svg|json)$',
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
'rules': {
|
|
85
|
-
'no-console': 0,
|
|
86
|
-
'quotes': ['error', 'single'],
|
|
87
|
-
'semi': ['warn', 'always'],
|
|
88
|
-
'comma-dangle': 0,
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
|
|
92
48
|
const styleLintConfig = {
|
|
93
49
|
'extends': 'stylelint-config-standard',
|
|
94
50
|
'plugins': ['stylelint-scss'],
|
|
@@ -99,6 +55,7 @@ const styleLintConfig = {
|
|
|
99
55
|
'selector-class-pattern': null, // TODO: remove and fix
|
|
100
56
|
'at-rule-no-unknown': null,
|
|
101
57
|
'function-no-unknown': null,
|
|
58
|
+
'declaration-property-value-no-unknown': null,
|
|
102
59
|
'no-invalid-position-at-import-rule': [
|
|
103
60
|
true,
|
|
104
61
|
{
|
|
@@ -158,6 +115,7 @@ export const makeConfig = (env, argv, options) => {
|
|
|
158
115
|
new CleanWebpackPlugin({
|
|
159
116
|
cleanStaleWebpackAssets: !isWatch
|
|
160
117
|
}),
|
|
118
|
+
new RemoveEmptyScriptsPlugin(),
|
|
161
119
|
new MiniCssExtractPlugin({
|
|
162
120
|
filename: 'css/[name].[contenthash:8].css',
|
|
163
121
|
chunkFilename: '[id].[contenthash:8].css'
|
|
@@ -167,7 +125,6 @@ export const makeConfig = (env, argv, options) => {
|
|
|
167
125
|
config: styleLintConfig,
|
|
168
126
|
}),
|
|
169
127
|
new EsLintPlugin({
|
|
170
|
-
baseConfig: esLintConfig,
|
|
171
128
|
overrideConfig: {
|
|
172
129
|
rules: {
|
|
173
130
|
"no-console": isProd ? 2 : 1,
|
package/package.json
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightscale/webpack-config",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Basic webpack config with js babel, postcss, scss, svg",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"auther": "Sam Light",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://git.lightscale.co.uk/lightscale-webpack-config.git"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
9
16
|
"dependencies": {
|
|
10
17
|
"@babel/core": "^7.12.10",
|
|
11
|
-
"@babel/eslint-parser": "^7.16.0",
|
|
12
18
|
"@babel/preset-env": "^7.12.11",
|
|
13
19
|
"ajv": "^8.12.0",
|
|
14
20
|
"autoprefixer": "^10.4.0",
|
|
15
|
-
"babel-loader": "^
|
|
16
|
-
"babel-plugin-polyfill-corejs3": "^0.
|
|
21
|
+
"babel-loader": "^10.0.0",
|
|
22
|
+
"babel-plugin-polyfill-corejs3": "^0.12.0",
|
|
17
23
|
"clean-terminal-webpack-plugin": "^3.0.0",
|
|
18
24
|
"clean-webpack-plugin": "^4.0.0",
|
|
19
25
|
"css-loader": "^7.0.0",
|
|
20
26
|
"eslint": "^9.0.0",
|
|
21
|
-
"eslint-webpack-plugin": "^
|
|
27
|
+
"eslint-webpack-plugin": "^5.0.0",
|
|
22
28
|
"glob": "^11.0.0",
|
|
23
29
|
"mini-css-extract-plugin": "^2.4.2",
|
|
24
30
|
"postcss": "^8.4.5",
|
|
@@ -30,14 +36,15 @@
|
|
|
30
36
|
"style-loader": "^4.0.0",
|
|
31
37
|
"stylelint": "^16.0.0",
|
|
32
38
|
"stylelint-config-recommended-scss": "^14.0.0",
|
|
33
|
-
"stylelint-config-standard": "^
|
|
39
|
+
"stylelint-config-standard": "^37.0.0",
|
|
34
40
|
"stylelint-scss": "^6.0.0",
|
|
35
41
|
"stylelint-webpack-plugin": "^5.0.0",
|
|
36
|
-
"svg-chunk-webpack-plugin": "^
|
|
42
|
+
"svg-chunk-webpack-plugin": "^7.0.0",
|
|
37
43
|
"webpack": "^5.11.1",
|
|
38
44
|
"webpack-assets-manifest": "^5.0.6",
|
|
39
|
-
"webpack-cli": "^
|
|
45
|
+
"webpack-cli": "^6.0.0",
|
|
40
46
|
"webpack-notifier": "^1.12.0",
|
|
41
|
-
"
|
|
47
|
+
"webpack-remove-empty-scripts": "^1.0.4",
|
|
48
|
+
"webpackbar": "^7.0.0"
|
|
42
49
|
}
|
|
43
50
|
}
|