canopy-webpack-config 3.2.0 → 4.0.0-beta.2

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.2",
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,8 @@
12
12
  "@babel/runtime": ">=7"
13
13
  },
14
14
  "dependencies": {
15
- "clean-webpack-plugin": "^3.0.0",
16
- "unused-files-webpack-plugin": "^3.4.0",
17
- "webpack-bundle-analyzer": "^3.3.2",
15
+ "clean-webpack-plugin": "^4.0.0",
16
+ "webpack-bundle-analyzer": "^4.5.0",
18
17
  "webpack-merge": "^4.2.1"
19
18
  }
20
19
  }
@@ -1,14 +1,13 @@
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 merge = require('webpack-merge')
6
5
  const fs = require("fs")
7
6
  const homedir = require("os").homedir()
8
7
 
9
8
  let isDevServer = false
10
9
 
11
- if (process.argv.some(arg => arg.includes('webpack-dev-server'))) {
10
+ if (process.argv.some(arg => arg.includes('serve'))) {
12
11
  isDevServer = true
13
12
  }
14
13
 
@@ -36,8 +35,12 @@ module.exports = function(name, overridesConfig) {
36
35
  entry: `./src/${name}.js`,
37
36
  output: {
38
37
  filename: `${name}.js`,
39
- jsonpFunction: "wpjsonp-"+name,
40
- libraryTarget: 'amd',
38
+ publicPath: '',
39
+ uniqueName: name,
40
+ library: {
41
+ type: 'amd',
42
+ name: name,
43
+ },
41
44
  path: path.resolve(process.cwd(), 'build'),
42
45
  chunkFilename: '[name].js',
43
46
  },
@@ -55,12 +58,6 @@ module.exports = function(name, overridesConfig) {
55
58
  ],
56
59
  },
57
60
  },
58
- // https://github.com/systemjs/systemjs#compatibility-with-webpack
59
- {
60
- parser: {
61
- system: false,
62
- },
63
- },
64
61
  ],
65
62
  },
66
63
  resolve: {
@@ -74,18 +71,6 @@ module.exports = function(name, overridesConfig) {
74
71
  new BundleAnalyzerPlugin({
75
72
  analyzerMode: env.analyze || 'disabled',
76
73
  }),
77
- new UnusedFilesWebpackPlugin({
78
- globOptions: {
79
- cwd: path.resolve(process.cwd(), 'src'),
80
- ignore: [
81
- "**/*.test.js",
82
- "**/*.spec.js",
83
- "**/*.js.snap",
84
- "**/test-setup.js",
85
- "**/.stories.js"
86
- ],
87
- }
88
- }),
89
74
  ],
90
75
  devtool: 'source-map',
91
76
  externals: [
@@ -113,9 +98,13 @@ module.exports = function(name, overridesConfig) {
113
98
  cert: fs.readFileSync(`${homedir}/.canopy-ssl/public.pem`),
114
99
  key: fs.readFileSync(`${homedir}/.canopy-ssl/key.pem`)
115
100
  },
116
- disableHostCheck: true,
117
- sockHost: host === "0.0.0.0" ? "localhost" : host, // Use localhost for the socket connection for CSP purposes
118
- sockPort: port,
101
+ allowedHosts: 'all',
102
+ client: {
103
+ webSocketURL: {
104
+ hostname: host === "0.0.0.0" ? "localhost" : host, // Use localhost for the socket connection for CSP purposes
105
+ port: port,
106
+ },
107
+ },
119
108
  headers: {
120
109
  "Access-Control-Allow-Origin": "*"
121
110
  },