with-monaco-editor-example-fix (#13186)

* Modified nextjs config so that it works with all types of fonts and images.

* Update next.config.js

* Fix code

Co-authored-by: Tim Neutkens <timneutkens@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
TodorTotev 2020-05-22 21:11:01 +03:00 committed by GitHub
parent c67908c9a5
commit cb1d744151
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,19 +1,26 @@
const withCSS = require('@zeit/next-css')
const withFonts = require('next-fonts')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
module.exports = withCSS(
withFonts({
webpack: (config) => {
config.plugins.push(
new MonacoWebpackPlugin({
// Add languages as needed...
languages: ['javascript', 'typescript'],
filename: 'static/[name].worker.js',
})
)
module.exports = withCSS({
webpack: (config) => {
config.module.rules.push({
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: {
loader: 'url-loader',
options: {
limit: 100000,
},
},
})
return config
},
})
)
config.plugins.push(
new MonacoWebpackPlugin({
// Add languages as needed...
languages: ['javascript', 'typescript'],
filename: 'static/[name].worker.js',
})
)
return config
},
})