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',
|
|
|
|
devtool: 'cheap-module-eval-source-map',
|
2020-06-17 19:57:37 +08:00
|
|
|
context: path.join(__dirname, '../packages/jsx-explorer'),
|
2020-06-13 11:23:47 +08:00
|
|
|
entry: './src/index.js',
|
|
|
|
output: {
|
2020-06-17 19:57:37 +08:00
|
|
|
publicPath: './',
|
2020-06-13 11:23:47 +08:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.jsx?$/,
|
|
|
|
loader: 'babel-loader',
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
|
|
|
loader: 'url-loader',
|
|
|
|
options: {
|
|
|
|
limit: 10000,
|
|
|
|
name: 'dist/fonts/[name].[hash:7].[ext]',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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
|
|
|
],
|
|
|
|
node: {
|
|
|
|
fs: 'empty',
|
|
|
|
},
|
|
|
|
};
|