mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-05-20 04:38:57 +00:00
39 lines
968 B
JavaScript
39 lines
968 B
JavaScript
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
module.exports = {
|
|
output: {
|
|
filename: '[contenthash].js',
|
|
},
|
|
devtool: 'source-map',
|
|
resolve: {
|
|
extensions: ['.mjs', '.js', '.ts'],
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/,
|
|
use: [MiniCssExtractPlugin.loader, 'css-loader'],
|
|
},
|
|
{
|
|
// Monaco editor uses .ttf icons.
|
|
test: /\.(svg|ttf)$/,
|
|
type: 'asset/resource',
|
|
},
|
|
{
|
|
test: /schema\.json$/,
|
|
type: 'asset/resource',
|
|
},
|
|
{
|
|
test: /\.ts$/,
|
|
loader: 'ts-loader',
|
|
options: { transpileOnly: true },
|
|
},
|
|
],
|
|
},
|
|
optimization: {
|
|
minimizer: ['...', new CssMinimizerPlugin()],
|
|
},
|
|
plugins: [new HtmlWebPackPlugin(), new MiniCssExtractPlugin({ filename: '[contenthash].css' })],
|
|
};
|