babel-plugin-jsx/scripts/webpack.base.conf.js

53 lines
1.1 KiB
JavaScript
Raw Normal View History

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