-
-
Notifications
You must be signed in to change notification settings - Fork 531
Expand file tree
/
Copy pathweb.webpack.dev.js
More file actions
44 lines (43 loc) · 1.64 KB
/
web.webpack.dev.js
File metadata and controls
44 lines (43 loc) · 1.64 KB
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
const { merge } = require('webpack-merge')
const config = require('./web.webpack.config.js')
const mergeWithEnvDefaults = require('./web.webpack-defaults.js')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
module.exports = (env, argv) => {
const port = argv.port || 3001
mergeWithEnvDefaults(env)
return merge(config(env, argv), {
mode: 'development',
devtool: process.env.BUILD_TARGET === 'extension' ? 'cheap-module-source-map' : 'inline-source-map',
optimization: {
minimize: false,
},
output: {
publicPath: '/',
},
plugins: [new ReactRefreshWebpackPlugin()],
devServer: {
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Security-Policy':
"default-src https: 'self'; base-uri 'self'; child-src * blob:; connect-src * blob:; font-src * data:; form-action 'self'; frame-ancestors * file:; frame-src * blob:; img-src 'self' * data: blob:; manifest-src 'self'; media-src 'self' blob: *.standardnotes.com; object-src 'self' blob: *.standardnotes.com; script-src 'self' 'sha256-r26E+iPOhx7KM7cKn4trOSoD8u5E7wL7wwJ8UrR+rGs=' 'sha256-ZRgzGkk7dE5Vafy/x+4fOkq6Ysvyn2dpddLN4XBd9hI=' 'unsafe-eval' 'wasm-unsafe-eval'; worker-src 'self'; style-src *;",
},
hot: true,
static: './dist',
port,
historyApiFallback: true,
devMiddleware: {
writeToDisk: argv.writeToDisk,
},
proxy: {
'/assets': {
target: 'https://assets.standardnotes.com',
changeOrigin: true,
secure: false,
pathRewrite: {
'^/assets': '',
},
},
},
},
})
}