mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-15 11:37:57 +01:00
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
const path = require('path');
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
const CompressionPlugin = require('compression-webpack-plugin');
|
|
|
|
|
|
module.exports = {
|
|
entry: {
|
|
app: path.join(__dirname, 'src', 'index.tsx')
|
|
},
|
|
target: 'web',
|
|
resolve: {
|
|
extensions: ['.ts', '.tsx', '.js', '.jsx']
|
|
},
|
|
module: {
|
|
rules: [{
|
|
test: /\.tsx?$/,
|
|
use: 'ts-loader',
|
|
exclude: '/node_modules/'
|
|
},
|
|
{
|
|
test: /\.(png|jpe?g|gif|svg)$/,
|
|
use: [{
|
|
loader: 'file-loader',
|
|
options: {
|
|
esModule: false,
|
|
}
|
|
}]
|
|
},
|
|
]
|
|
},
|
|
plugins: [
|
|
new CleanWebpackPlugin(),
|
|
new CopyWebpackPlugin({
|
|
patterns: [{
|
|
from: 'public/*',
|
|
to: '[name].[ext]',
|
|
globOptions: {
|
|
ignore: [
|
|
'**/index.html'
|
|
]
|
|
}
|
|
}]
|
|
}),
|
|
new CompressionPlugin()
|
|
]
|
|
} |