generated from Liinkiing/react-extension-webpack-typescript-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.ts
32 lines (31 loc) · 933 Bytes
/
webpack.dev.ts
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
import merge from 'webpack-merge'
import path from 'path'
import common, { build, src } from './webpack.common'
import CopyWebpackPlugin from 'copy-webpack-plugin'
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ExtensionReloader = require('webpack-extension-reloader')
export default merge.smart(common, {
mode: 'development',
devtool: 'inline-source-map',
entry: {
popup: ['react-devtools', path.join(__dirname, 'src/popup/index.tsx')]
},
plugins: [
new CopyWebpackPlugin([
{
from: path.join(path.resolve(src, '..'), 'manifest.json'),
to: path.join(build, 'manifest.json'),
toType: 'file'
}
]),
new ExtensionReloader({
manifest: path.resolve(__dirname, 'manifest.json'),
entries: {
contentScript: 'contentscript',
reloadPage: true,
background: 'background',
extensionPage: 'popup'
}
})
]
})