mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-11 01:43:23 +01:00
41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
const path = require('path');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
|
|
/** @type {import('webpack').Configuration} */
|
|
module.exports = {
|
|
entry: './src/index.tsx',
|
|
output: {
|
|
path: path.resolve(__dirname, 'lib'),
|
|
filename: 'webcomponent.js',
|
|
publicPath: '/',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
use: 'babel-loader',
|
|
test: /.(js|jsx)$/,
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
use: 'ts-loader',
|
|
test: /\.(ts|tsx)$/,
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
type: 'asset',
|
|
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
|
|
},
|
|
plugins: [
|
|
new CleanWebpackPlugin(),
|
|
new HtmlWebpackPlugin({
|
|
template: './public/index.html',
|
|
}),
|
|
],
|
|
};
|