-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
27 lines (25 loc) · 886 Bytes
/
webpack.dev.js
File metadata and controls
27 lines (25 loc) · 886 Bytes
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
const webpack = require('webpack');
const { merge } = require('webpack-merge');
const { webpackCommonConfig } = require('./webpack.common.js');
const packageInfo = require('./package.json');
module.exports = (env) => {
const isExtension = env?.extension;
const buildTarget = isExtension ? 'extension' : 'web';
const entry = isExtension ? './src/app/extension/index.tsx' : './src/app/web/index.tsx';
return merge(webpackCommonConfig, {
entry,
mode: 'development',
devtool: 'inline-source-map',
devServer: {
open: true,
port: 3000,
hot: true, // 모듈 전체를 다시 로드하지 않고 변경사항만 확인하여 로드
},
plugins: [
new webpack.DefinePlugin({
'process.env.APP_VERSION': JSON.stringify(packageInfo.version),
'process.env.BUILD_TARGET': JSON.stringify(buildTarget),
}),
],
});
};