2020-06-13 11:23:47 +08:00
|
|
|
const path = require('path');
|
|
|
|
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
|
2020-06-17 19:57:37 +08:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
2020-06-13 11:23:47 +08:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: 'development',
|
2020-07-09 20:51:47 +08:00
|
|
|
devtool: false,
|
2020-06-17 19:57:37 +08:00
|
|
|
context: path.join(__dirname, '../packages/jsx-explorer'),
|
2020-07-09 20:51:47 +08:00
|
|
|
entry: './src/index.ts',
|
2020-06-13 11:23:47 +08:00
|
|
|
output: {
|
2020-06-17 19:57:37 +08:00
|
|
|
publicPath: './',
|
2020-06-13 11:23:47 +08:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
2020-07-09 20:51:47 +08:00
|
|
|
test: /\.tsx?$/,
|
|
|
|
loader: 'ts-loader',
|
2020-06-13 11:23:47 +08:00
|
|
|
exclude: /node_modules/,
|
2020-07-09 20:51:47 +08:00
|
|
|
options: {
|
|
|
|
compilerOptions: { downlevelIteration: true },
|
|
|
|
},
|
2020-06-13 11:23:47 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
|
|
|
loader: 'url-loader',
|
|
|
|
options: {
|
|
|
|
limit: 10000,
|
2020-07-09 20:51:47 +08:00
|
|
|
name: 'fonts/[name].[hash:7].[ext]',
|
2020-06-13 11:23:47 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: [
|
|
|
|
'style-loader', 'css-loader',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new MonacoWebpackPlugin(),
|
2020-06-17 19:57:37 +08:00
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'index.html',
|
|
|
|
filename: 'index.html',
|
|
|
|
}),
|
2020-06-13 11:23:47 +08:00
|
|
|
],
|
2020-07-09 20:51:47 +08:00
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js'],
|
|
|
|
},
|
2020-06-13 11:23:47 +08:00
|
|
|
node: {
|
|
|
|
fs: 'empty',
|
|
|
|
},
|
|
|
|
};
|