forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
35 lines (34 loc) · 1.01 KB
/
webpack.config.js
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
const path = require('path')
const webpack = require('webpack')
module.exports = {
mode: process.env.NODE_ENV || 'development',
entry: './app/v2/init.js',
// https://github.com/cypress-io/cypress/issues/15032
// Default webpack output setting is "eval".
// Chrome doesn't allow "eval" inside extensions.
devtool: 'inline-cheap-source-map',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'background.js',
path: path.resolve(__dirname, 'dist', 'v2'),
},
plugins: [
new webpack.DefinePlugin({
// The @packages/extension needs access to the process.env.NODE_DEBUG variable.
// Since it's one variable, it makes most sense to just use the
// DefinePlugin to push the value into the bundle instead of providing the whole process
'process.env.NODE_DEBUG': JSON.stringify('process.env.NODE_DEBUG'),
}),
],
}