2018-06-07 11:14:27 +00:00
|
|
|
/* eslint-disable */
|
|
|
|
const withLess = require('@zeit/next-less')
|
2018-11-11 17:09:30 +00:00
|
|
|
const lessToJS = require('less-vars-to-js')
|
|
|
|
const fs = require('fs')
|
|
|
|
const path = require('path')
|
|
|
|
|
|
|
|
// Where your antd-custom.less file lives
|
|
|
|
const themeVariables = lessToJS(
|
|
|
|
fs.readFileSync(
|
2018-12-10 11:20:01 +00:00
|
|
|
path.resolve(__dirname, './assets/antd-custom.less'),
|
2018-11-11 17:09:30 +00:00
|
|
|
'utf8'
|
|
|
|
)
|
|
|
|
)
|
2018-06-07 11:14:27 +00:00
|
|
|
|
2018-08-23 14:48:17 +00:00
|
|
|
// fix: prevents error when .less files are required by node
|
|
|
|
if (typeof require !== 'undefined') {
|
|
|
|
require.extensions['.less'] = (file) => {}
|
|
|
|
}
|
|
|
|
|
2018-06-07 11:14:27 +00:00
|
|
|
module.exports = withLess({
|
|
|
|
lessLoaderOptions: {
|
|
|
|
javascriptEnabled: true,
|
2018-11-11 17:09:30 +00:00
|
|
|
modifyVars: themeVariables // make your antd custom effective
|
2018-06-07 11:14:27 +00:00
|
|
|
},
|
2018-11-11 17:09:30 +00:00
|
|
|
|
2018-06-07 11:14:27 +00:00
|
|
|
})
|