mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 00:32:56 +03:00
* fixes * feat(jsonld): added flatten, compact, n-quads, expanded and framed closes #109
73 lines
1.6 KiB
JavaScript
73 lines
1.6 KiB
JavaScript
const withTypescript = require("@zeit/next-typescript");
|
|
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
|
|
const withCSS = require("@zeit/next-css");
|
|
const webpack = require("webpack");
|
|
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
|
|
|
|
const config = {
|
|
webpack(config, options) {
|
|
config.node = {
|
|
fs: "empty",
|
|
module: "empty",
|
|
net: "mock",
|
|
tls: "mock"
|
|
};
|
|
|
|
if (options.isServer && options.dev)
|
|
config.plugins.push(new ForkTsCheckerWebpackPlugin());
|
|
|
|
config.plugins.push(
|
|
new webpack.DefinePlugin({
|
|
"process.env.DEV": JSON.stringify(options.dev),
|
|
IN_BROWSER: !options.isServer,
|
|
IS_DEV: options.dev
|
|
}),
|
|
new MonacoWebpackPlugin({
|
|
output: "../../static",
|
|
languages: [
|
|
"json",
|
|
"typescript",
|
|
"css",
|
|
"javascript",
|
|
"html",
|
|
"sql",
|
|
"xml",
|
|
"yaml",
|
|
"rust",
|
|
"markdown",
|
|
"go",
|
|
"graphql",
|
|
"scala",
|
|
"plaintext",
|
|
"java"
|
|
],
|
|
features: [
|
|
"folding",
|
|
"goToDefinitionMouse",
|
|
"goToDefinitionCommands",
|
|
"referenceSearch"
|
|
]
|
|
})
|
|
);
|
|
|
|
config.module.rules.unshift({
|
|
test: /\.worker\.ts/,
|
|
use: {
|
|
loader: "worker-loader",
|
|
options: {
|
|
name: "static/[hash].worker.js",
|
|
publicPath: "/_next/"
|
|
}
|
|
}
|
|
});
|
|
|
|
config.output.globalObject = `this`;
|
|
|
|
return config;
|
|
},
|
|
|
|
target: "serverless"
|
|
};
|
|
|
|
module.exports = withCSS(withTypescript(config));
|