babel-plugin-jsx/scripts/webpack.base.conf.js
Amour1688 bc4ef2c028
refactor: with TypeScript (#24)
* refactor: add ts support (#19)

Co-authored-by: 逆寒 <869732751@qq.com>
2020-07-09 20:51:47 +08:00

53 lines
1.1 KiB
JavaScript

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