wisemapping-frontend/packages/editor/webpack.common.js

45 lines
959 B
JavaScript
Raw Normal View History

const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
2022-01-24 16:11:38 +01:00
output: {
path: path.resolve(__dirname, 'dist'),
2022-01-25 15:10:00 +01:00
filename: '[name].js',
publicPath: '',
2022-01-24 16:11:38 +01:00
library: {
type: 'umd',
},
},
entry: {
2022-01-25 15:10:00 +01:00
"editor.bundle": path.join(__dirname, 'src', 'index.tsx')
},
2022-01-24 16:11:38 +01:00
mode: 'development',
devtool: 'source-map',
target: 'web',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx']
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: '/node_modules/'
2022-01-24 16:11:38 +01:00
},
{
test: /\.(png|jpe?g|gif|svg)$/,
type: 'asset/inline',
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader'],
},
],
},
plugins: [
new CleanWebpackPlugin(),
2022-01-25 15:10:00 +01:00
]
}