mirror of
https://github.com/ritz078/transform.git
synced 2026-11-23 01:12:07 +03:00
* HTML to Pug converter (#127) * feat(pug): add HTML to pug converter * fix(pug): added package details * feat(analyze): added webpack bundle analyzer * fix(rust): handle special characters and duplicate keys (#131) * remove duplicate google tag manager (#122) * Update _app.tsx (#124) * docs: add timneutkens as a contributor (#125) * docs: update README.md * docs: update .all-contributorsrc * Upgrade Next.js to 9 (#126) * Upgrade Next.js to 9 * Add back engines key * Add globalObject Brings in suggestion from https://github.com/zeit/next.js/issues/7873#issuecomment-512795482 * Add temporary fix for window issue * fix(font): add fallback font for non mac browsers (#130) closes #129 * fix(rust): handle special characters and duplicate keys closes #97 * fix(rust): handle special chars closes #97, closes #95, closes #89, closes #62 * chore(rust): remove settings * feat(kotlin): added JSON to kotlin and json schema * fixes * fixes * fixes * fixes * fixes * added favicon * social media tags
80 lines
1.9 KiB
JavaScript
80 lines
1.9 KiB
JavaScript
const withCSS = require("@zeit/next-css");
|
|
const webpack = require("webpack");
|
|
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
|
|
const withBundleAnalyzer = require("@next/bundle-analyzer")({
|
|
enabled: process.env.ANALYZE === "true"
|
|
});
|
|
|
|
const config = {
|
|
webpack(config, options) {
|
|
config.node = {
|
|
fs: "empty",
|
|
module: "empty",
|
|
net: "mock",
|
|
tls: "mock"
|
|
};
|
|
|
|
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",
|
|
"pug"
|
|
],
|
|
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 = 'typeof self !== "object" ? self : this';
|
|
|
|
// Temporary fix for https://github.com/zeit/next.js/issues/8071
|
|
config.plugins.forEach(plugin => {
|
|
if (plugin.definitions && plugin.definitions["typeof window"]) {
|
|
delete plugin.definitions["typeof window"];
|
|
}
|
|
});
|
|
|
|
config.output.webassemblyModuleFilename = "static/wasm/[modulehash].wasm";
|
|
|
|
return config;
|
|
},
|
|
target: "serverless"
|
|
};
|
|
|
|
module.exports = withBundleAnalyzer(withCSS(config));
|