mirror of
https://github.com/dstotijn/hetty
synced 2024-11-26 21:50:19 +00:00
91947b9ffa
This ensures that the Next.js app works consistently both when running in dev mode as well as when it has been exported to static HTML/JS.
34 lines
739 B
JavaScript
34 lines
739 B
JavaScript
const withCSS = require("@zeit/next-css");
|
|
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
|
|
|
|
module.exports = withCSS({
|
|
trailingSlash: true,
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: "/api/:path/",
|
|
destination: "http://localhost:8080/api/:path/",
|
|
},
|
|
];
|
|
},
|
|
webpack: (config) => {
|
|
config.module.rules.push({
|
|
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
|
|
use: {
|
|
loader: "url-loader",
|
|
options: {
|
|
limit: 100000,
|
|
},
|
|
},
|
|
});
|
|
|
|
config.plugins.push(
|
|
new MonacoWebpackPlugin({
|
|
languages: ["html", "json", "javascript"],
|
|
filename: "static/[name].worker.js",
|
|
})
|
|
);
|
|
|
|
return config;
|
|
},
|
|
});
|