mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-23 10:03:53 +03:00
adff9dd9f9
* Update for Edge build * Refactor builds * Update permissions * Update tests
70 lines
1.5 KiB
TypeScript
70 lines
1.5 KiB
TypeScript
import * as path from 'path';
|
|
import * as webpack from 'webpack';
|
|
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
|
|
export default (env: { production?: boolean } = {}): webpack.Configuration => ({
|
|
mode: env.production ? 'production' : 'development',
|
|
entry: {
|
|
app: ['./src/index'],
|
|
},
|
|
output: {
|
|
library: 'ReduxDevToolsApp',
|
|
libraryExport: 'Root',
|
|
libraryTarget: 'umd',
|
|
path: path.resolve(__dirname, 'umd'),
|
|
filename: env.production
|
|
? 'redux-devtools-app.min.js'
|
|
: 'redux-devtools-app.js',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(js|ts)x?$/,
|
|
loader: 'babel-loader',
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
test: /\.html$/,
|
|
loader: 'html-loader',
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
|
|
},
|
|
{
|
|
test: /\.woff2$/,
|
|
type: 'asset/inline',
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
'process.env': {
|
|
PLATFORM: JSON.stringify('web'),
|
|
},
|
|
}),
|
|
new ForkTsCheckerWebpackPlugin({
|
|
typescript: {
|
|
configFile: 'tsconfig.json',
|
|
},
|
|
}),
|
|
],
|
|
externals: {
|
|
react: {
|
|
root: 'React',
|
|
commonjs2: 'react',
|
|
commonjs: 'react',
|
|
amd: 'react',
|
|
},
|
|
'react-dom': {
|
|
root: 'ReactDOM',
|
|
commonjs2: 'react-dom',
|
|
commonjs: 'react-dom',
|
|
amd: 'react-dom',
|
|
},
|
|
},
|
|
});
|