forked from Rundll86/fs-context
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ext.js
57 lines (57 loc) · 1.65 KB
/
webpack.config.ext.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
52
53
54
55
56
57
const WebpackBar = require("webpackbar");
const path = require("path");
const serverConfig = require("./config/server");
const commonConfig = require("./config/webpack");
const FriendlyErrorsWebpackPlugin = require("friendly-errors-webpack-plugin");
/**
* @type {import('webpack').Configuration}
*/
module.exports = {
...commonConfig.staticShow,
entry: "@framework/entry.ts",
output: {
// filename: `${serverConfig.extension.output}.dist.js`,
filename:"[name].dist.js",
path: path.resolve(__dirname, `dist/${serverConfig.extension.output}`),
clean: true,
library: serverConfig.extension.output,
libraryTarget: "window"
},
module: {
rules: [
...commonConfig.loaderRule,
{
test: /\.css$/i,
use: ["style-loader", "css-loader"]
}
]
},
resolve: {
extensions: [...commonConfig.fileExtensions],
alias: commonConfig.alias
},
plugins: [
new WebpackBar({
name: "Extension",
color: "green"
}),
new FriendlyErrorsWebpackPlugin({
compilationSuccessInfo: {
messages: [
`Live is running on http://127.0.0.1:${serverConfig.extension.port}/${serverConfig.extension.output}.dist.js`
]
},
clearConsole: true
})
],
devServer: {
...commonConfig.devServer,
headers: {
'Access-Control-Allow-Origin': '*'
},
port: serverConfig.extension.port,
hot: false,
liveReload: false,
webSocketServer: false
}
};