forked from Open-Federation/json-schema-editor-visual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (42 loc) · 1.48 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
36
37
38
39
40
41
42
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: './package/index.js',
mode: "production",
output: {
publicPath: "/dist/",
libraryTarget: "umd",
library: ['schema'],
filename: '[name].js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
},
{ test: /\.less$/, use: ["style-loader", "css-loader", "less-loader"] }
]
},
plugins: [new ExtractTextPlugin("main.css")],
externals: [
{ react: { commonjs: "react", commonjs2: "react",amd: 'react', root: ['React'] } },
{ "react-redux": { commonjs: "react-redux", commonjs2: "react-redux",amd:"react-redux" } },
{ underscore: { commonjs: "underscore", commonjs2: "underscore",amd:'underscore', root: ['_'] } },
{ brace: { commonjs: "brace", commonjs2: "brace", amd: 'brace', root: ['ace'] } },
{ moox: { commonjs: "moox", commonjs2: "moox", amd: 'moox' } },
{ "react-dom": { commonjs: "react-dom", commonjs2: "react-dom", amd: 'react-dom', root: ['ReactDom'] } },
{ redux: { commonjs: "redux", commonjs2: "redux", amd: 'redux'} },
{ "prop-types": { commonjs: "prop-types", commonjs2: "prop-types",amd: 'prop-types' } },
{ antd: { commonjs: "antd", commonjs2: "antd", amd: 'antd' } }
]
};