redux-devtools/packages/redux-devtools-core/webpack.config.umd.js

67 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-01-03 17:14:25 +03:00
const path = require('path');
const webpack = require('webpack');
2019-01-10 21:51:14 +03:00
module.exports = (env = {}) => ({
mode: env.production ? 'production' : 'development',
2019-01-10 21:51:14 +03:00
entry: {
app: ['./src/app/index.js'],
2019-01-10 21:51:14 +03:00
},
output: {
library: 'ReduxDevTools',
libraryExport: 'default',
2019-01-10 21:51:14 +03:00
libraryTarget: 'umd',
path: path.resolve(__dirname, 'umd'),
filename: env.production
2019-01-10 21:51:14 +03:00
? 'redux-devtools-core.min.js'
: 'redux-devtools-core.js',
2019-01-10 21:51:14 +03:00
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
2019-01-10 21:51:14 +03:00
},
{
test: /\.html$/,
loader: 'html-loader',
2019-01-03 17:14:25 +03:00
},
2019-01-10 21:51:14 +03:00
{
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
2019-01-10 21:51:14 +03:00
},
{
test: /\.(png|gif|jpg)$/,
loader: 'url-loader',
options: { limit: '25000' },
2019-01-10 21:51:14 +03:00
},
{
test: /\.(ttf|eot|svg|woff|woff2)$/,
loader: 'url-loader',
},
],
2019-01-10 21:51:14 +03:00
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
PLATFORM: JSON.stringify('web'),
},
}),
2019-01-10 21:51:14 +03:00
],
externals: {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
2019-01-10 21:51:14 +03:00
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
2019-01-10 21:51:14 +03:00
},
});