-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
37 lines (31 loc) · 1.03 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
const CopyWebpackPlugin = require('copy-webpack-plugin'); // Copy files to output folder
const webpackMerge = require('webpack-merge');
const createWebpackConfig = require('./webpack.common');
module.exports = webpackMerge(createWebpackConfig(), {
entry: {
core: './src/core/index.js',
react: './src/react/index.js',
},
externals: [
'prop-types',
'react',
'react-dom',
],
output: {
filename: '[name]/bundle.js', // myapp1.bundle.js | 'main.js' | ...
library: ['Frigate', '[name]'],
libraryTarget: 'umd',
},
plugins: [
new CopyWebpackPlugin([
{ from: './src/react/index.d.ts', to: 'react/bundle.d.ts' },
{ from: './src/react/index.d.ts', to: 'react/' },
{ from: './src/react/package.json', to: 'react/' },
{ from: './src/core/package.json', to: 'core/' },
{ from: './src/core/README.md', to: 'core/' },
{ from: './src/react/README.md', to: 'react/' },
{ from: 'LICENSE', to: 'core/' },
{ from: 'LICENSE', to: 'react/' },
]),
],
});