isoflow/webpack/prod.config.js

56 lines
1.1 KiB
JavaScript
Raw Normal View History

const path = require('path');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2023-03-16 21:27:09 +00:00
module.exports = {
mode: 'production',
entry: {
'index': './src/Isoflow.tsx',
'/validation/scene': './src/validation/scene.ts',
2023-08-21 12:47:26 +00:00
'/isopacks': './src/isopacks/index.ts',
},
2023-03-16 21:27:09 +00:00
output: {
path: path.resolve(__dirname, '../dist'),
filename: '[name].js',
libraryTarget: 'commonjs2'
2023-03-16 21:27:09 +00:00
},
externals: {
react: {
commonjs: 'react',
commonjs2: 'react',
amd: 'React',
root: 'React'
2023-03-16 21:27:09 +00:00
},
'react-dom': {
commonjs: 'react-dom',
commonjs2: 'react-dom',
amd: 'ReactDOM',
root: 'ReactDOM'
}
2023-03-16 21:27:09 +00:00
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: 'ts-loader',
exclude: /node_modules/
2023-03-16 21:27:09 +00:00
},
2023-07-12 11:16:52 +00:00
{
test: /\.css$/i,
use: ['style-loader', 'css-loader']
2023-07-12 11:16:52 +00:00
},
{
test: /\.svg$/,
use: [
{
loader: 'svg-url-loader'
}
]
}
]
2023-03-16 21:27:09 +00:00
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
plugins: [new TsconfigPathsPlugin()]
}
2023-03-16 21:27:09 +00:00
};