canopy-webpack-config 3.1.0 → 4.0.0-beta.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 +3 -3
- package/src/canopy-webpack-config.js +23 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canopy-webpack-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-beta.1",
|
|
4
4
|
"description": "Some defaults for webpack configs at canopy",
|
|
5
5
|
"main": "src/canopy-webpack-config.js",
|
|
6
6
|
"repository": "git@github.com:CanopyTax/canopy-webpack-config.git",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"@babel/runtime": ">=7"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"clean-webpack-plugin": "^
|
|
15
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
16
16
|
"unused-files-webpack-plugin": "^3.4.0",
|
|
17
|
-
"webpack-bundle-analyzer": "^
|
|
17
|
+
"webpack-bundle-analyzer": "^4.5.0",
|
|
18
18
|
"webpack-merge": "^4.2.1"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
2
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
|
|
3
|
-
const merge = require('webpack-merge')
|
|
4
3
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
|
5
|
-
const {UnusedFilesWebpackPlugin} = require('unused-files-webpack-plugin')
|
|
4
|
+
const { UnusedFilesWebpackPlugin } = require('unused-files-webpack-plugin');
|
|
5
|
+
const merge = require('webpack-merge')
|
|
6
6
|
const fs = require("fs")
|
|
7
7
|
const homedir = require("os").homedir()
|
|
8
8
|
|
|
9
9
|
let isDevServer = false
|
|
10
10
|
|
|
11
|
-
if (process.argv.some(arg => arg.includes('
|
|
11
|
+
if (process.argv.some(arg => arg.includes('serve'))) {
|
|
12
12
|
isDevServer = true
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -36,8 +36,12 @@ module.exports = function(name, overridesConfig) {
|
|
|
36
36
|
entry: `./src/${name}.js`,
|
|
37
37
|
output: {
|
|
38
38
|
filename: `${name}.js`,
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
publicPath: '',
|
|
40
|
+
uniqueName: name,
|
|
41
|
+
library: {
|
|
42
|
+
type: 'amd',
|
|
43
|
+
name: name,
|
|
44
|
+
},
|
|
41
45
|
path: path.resolve(process.cwd(), 'build'),
|
|
42
46
|
chunkFilename: '[name].js',
|
|
43
47
|
},
|
|
@@ -55,12 +59,6 @@ module.exports = function(name, overridesConfig) {
|
|
|
55
59
|
],
|
|
56
60
|
},
|
|
57
61
|
},
|
|
58
|
-
// https://github.com/systemjs/systemjs#compatibility-with-webpack
|
|
59
|
-
{
|
|
60
|
-
parser: {
|
|
61
|
-
system: false,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
62
|
],
|
|
65
63
|
},
|
|
66
64
|
resolve: {
|
|
@@ -78,10 +76,12 @@ module.exports = function(name, overridesConfig) {
|
|
|
78
76
|
globOptions: {
|
|
79
77
|
cwd: path.resolve(process.cwd(), 'src'),
|
|
80
78
|
ignore: [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
'**/*.test.js',
|
|
80
|
+
'**/*.spec.js',
|
|
81
|
+
'**/*.js.snap',
|
|
82
|
+
'**/test-setup.js',
|
|
83
|
+
'**/*.stories.js',
|
|
84
|
+
'**/*.story.js',
|
|
85
85
|
],
|
|
86
86
|
}
|
|
87
87
|
}),
|
|
@@ -92,6 +92,7 @@ module.exports = function(name, overridesConfig) {
|
|
|
92
92
|
/^canopy-sofe-extensions$/,
|
|
93
93
|
/^lodash$/,
|
|
94
94
|
/^moment$/,
|
|
95
|
+
/^luxon$/,
|
|
95
96
|
/^online-listener$/,
|
|
96
97
|
/^prop-types$/,
|
|
97
98
|
/^react-dom$/,
|
|
@@ -111,9 +112,13 @@ module.exports = function(name, overridesConfig) {
|
|
|
111
112
|
cert: fs.readFileSync(`${homedir}/.canopy-ssl/public.pem`),
|
|
112
113
|
key: fs.readFileSync(`${homedir}/.canopy-ssl/key.pem`)
|
|
113
114
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
allowedHosts: 'all',
|
|
116
|
+
client: {
|
|
117
|
+
webSocketURL: {
|
|
118
|
+
hostname: host === "0.0.0.0" ? "localhost" : host, // Use localhost for the socket connection for CSP purposes
|
|
119
|
+
port: port,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
117
122
|
headers: {
|
|
118
123
|
"Access-Control-Allow-Origin": "*"
|
|
119
124
|
},
|