Files
transform/next.config.js
Ritesh Kumar 1bd559514b Transform 2.0 (#101)
* feat(init): added EditorPanel with prettier, copy and settings support

* chore(static): ignore static

* feat: added navigator

* feat:

* feat(settings): added sessionStorage support for settings

* feat(message): add messaging support in editors

* feat(preview): added support for preview panel

* fix(settings): use localstorage for settings instead of session storage

* feat:

* feat(css-to-js): implemented React section

* feat(schema): add json to schema conversions

* feat(others): implemented xml, yaml and markdown conversions

* feat(babel): added flow to typescript converter

* feat(graphql): implemented graphql to typescript

* feat(graphql): added some transformations

* fix: add support for different default value in one language

* feat(graphql): added components, resolver signatures and mongodb

* feat:

* scala case class

* fix(memory): worker-loader patch applied to fix memory overflow crash

* feat: added json schema to typescript

*     icon: <GraphQLIcon />,

* feat(navigator): shorter naming and new categories

* route fixes

* navigator

* perf(workers): create separate file and remove fallback

* fix(navigator): completed

* build(snack):

* fixes

* fixes

* fix(safari):

* added json-to-mobx-state tree

* fix(native): snacksession

* fixes

* added logo

* navigator

* fixes

* custom header

* fixes

* refactor(settings): move settings to left side

* feat: set up redirects

* feat(seo): added title and description

* feat(error): added custom error page

* ga-script

* feat:

* fixes

* fixe

* fixes

* fixes

* fix:
2019-07-18 19:07:48 +05:30

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: "server"
};
module.exports = withCSS(withTypescript(config));