forked from ava-labs/core-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
51 lines (49 loc) · 1.33 KB
/
webpack.dev.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const { DefinePlugin } = require('webpack');
const Dotenv = require('dotenv-webpack');
const CopyPlugin = require('copy-webpack-plugin');
const {
transformManifestFiles,
} = require('./build-scripts/manifestHelpers.js');
require('dotenv').config({ path: './.env' });
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
plugins: [
new Dotenv({
ignoreStub: true,
safe: true, // load '.env.example' to verify the '.env' variables are all set
allowEmptyValues: true,
}),
new DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
},
}),
new CopyPlugin({
patterns: [
{
context: 'manifest/',
from: '**/*.json',
to: '../',
transform: transformManifestFiles({
name: 'Core Dev',
shortName: 'Core Dev',
actionDefaultTitle: 'Core Dev Browser Extension',
oAuthClientId: process.env.GOOGLE_OAUTH_CLIENT_ID,
publicKey: process.env.EXTENSION_PUBLIC_KEY,
}),
force: true,
},
],
options: {
concurrency: 100,
},
}),
],
resolve: {
extensions: ['.ts', '.tsx', '.js'],
symlinks: false,
},
});