-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathnext.config.js
53 lines (49 loc) · 1.31 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const withLess = require('./config/withLess')
const withCss = require('./config/withCSS')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
const isProd = (process.env.NODE_ENV || 'production') === 'production'
console.log(isProd)
module.exports = withCss(
withLess({
lessLoaderOptions: {
javascriptEnabled: true
},
assetPrefix: isProd ? '/zaku/' : '',
webpack(config) {
config.module.rules = [
...config.module.rules,
{
test: /\.ttf$/,
use: [
'file-loader?outputPath=static/css&publicPath=/_next/static/css'
]
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
use: ['url-loader']
}
]
config.plugins.push(
new MonacoWebpackPlugin({
publicPath: '_next',
filename: `static/[name].worker.js`
})
)
// return Object.assign(config, {
// target: 'electron-renderer',
// devtool: 'cheap-module-source-map',
// plugins: config.plugins.filter(p => {
// return p.constructor.name !== 'UglifyJsPlugin'
// })
// })
return config
},
useFileSystemPublicRoutes: false,
exportPathMap() {
return {
'/main': { page: '/main' },
'/': { page: '/main' }
}
}
})
)