nexus/website/webpack.config.js

52 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2018-11-09 01:04:48 +08:00
"use strict";
/**
* @type {import('monaco-editor-webpack-plugin').default}
*/
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
2018-11-09 01:04:48 +08:00
/**
* @type {import('webpack').Configuration}
*/
2018-11-09 01:04:48 +08:00
module.exports = {
mode: "none",
devtool: "source-map",
2018-11-09 01:04:48 +08:00
entry: {
playground: "./playground/index.tsx",
2018-11-09 01:04:48 +08:00
},
output: {
2018-11-26 21:51:33 +08:00
publicPath: "/graphqliteral/playground-dist/",
2018-11-09 01:04:48 +08:00
filename: "[name].js",
path: __dirname + "/static/playground-dist",
2018-11-09 01:04:48 +08:00
},
resolve: {
alias: {
"monaco-editor": "monaco-editor/esm/vs/editor/editor.api.js",
},
extensions: [".ts", ".tsx", ".mjs", ".js", ".json", ".css"],
},
2018-11-09 01:04:48 +08:00
module: {
rules: [
{
test: /(^.?|\.[^d]|[^.]d|[^.][^d])\.tsx?$/,
2018-11-09 01:04:48 +08:00
exclude: /node_modules/,
loader: "babel-loader",
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
2018-11-09 01:04:48 +08:00
],
},
plugins: [
new MonacoWebpackPlugin({
languages: ["typescript"],
}),
],
2018-11-09 01:04:48 +08:00
externals: {
2018-11-21 22:19:24 +08:00
fs: "function() {}",
2018-11-09 01:04:48 +08:00
clipboard: "ClipboardJS",
react: "React",
"react-dom": "ReactDOM",
},
};