canopy-webpack-config 3.2.0 → 4.0.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canopy-webpack-config",
3
- "version": "3.2.0",
3
+ "version": "4.0.0-beta.0",
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": "^3.0.0",
15
+ "clean-webpack-plugin": "^4.0.0",
16
16
  "unused-files-webpack-plugin": "^3.4.0",
17
- "webpack-bundle-analyzer": "^3.3.2",
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('webpack-dev-server'))) {
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
- jsonpFunction: "wpjsonp-"+name,
40
- libraryTarget: 'amd',
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,11 +76,12 @@ module.exports = function(name, overridesConfig) {
78
76
  globOptions: {
79
77
  cwd: path.resolve(process.cwd(), 'src'),
80
78
  ignore: [
81
- "**/*.test.js",
82
- "**/*.spec.js",
83
- "**/*.js.snap",
84
- "**/test-setup.js",
85
- "**/.stories.js"
79
+ '**/*.test.js',
80
+ '**/*.spec.js',
81
+ '**/*.js.snap',
82
+ '**/test-setup.js',
83
+ '**/*.stories.js',
84
+ '**/*.story.js',
86
85
  ],
87
86
  }
88
87
  }),
@@ -113,9 +112,13 @@ module.exports = function(name, overridesConfig) {
113
112
  cert: fs.readFileSync(`${homedir}/.canopy-ssl/public.pem`),
114
113
  key: fs.readFileSync(`${homedir}/.canopy-ssl/key.pem`)
115
114
  },
116
- disableHostCheck: true,
117
- sockHost: host === "0.0.0.0" ? "localhost" : host, // Use localhost for the socket connection for CSP purposes
118
- sockPort: port,
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
+ },
119
122
  headers: {
120
123
  "Access-Control-Allow-Origin": "*"
121
124
  },