2 Star 2 Fork 2

lazyTai/next-with-antd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
next.config.js 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
lazyTai 提交于 6年前 . first commit
const withCSS = require('@zeit/next-css')
const withLess = require('@zeit/next-less')
const webpack = require('webpack')
/* Without CSS Modules, with PostCSS */
const argv = require("yargs").argv;
module.exports = withLess(withCSS({
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: "[local]___[hash:base64:5]",
},
webpack: function (config) {
config.externals = {
react: "React",
// "react-dom": "ReactDOM",
"react-router": "ReactRouter",
redux: "Redux",
echarts: "echarts",
konva: "Konva",
lodash: {
commonjs: 'lodash',
amd: 'lodash',
root: '_' // indicates global variable
},
axios: "axios",
mockjs: "mockjs"
}
config.devtool = "cheap-module-eval-source-map"
config.plugins = config.plugins.concat(
[
new webpack.DefinePlugin({
NODE_ENV: "'" + process.env.NODE_ENV + "'",
__API__: process.env.NODE_ENV == "production" ? "'/api'" : "'/api'",
UPLOAD_ACTION: "'https://upload-z2.qiniup.com'",
IMAGE_DOMAIN: "'https://qn.diyeetech.com'"
}),
]
)
return config;
}
}))
/* With CSS Modules */
// module.exports = withCSS({ cssModules: true })
/* With additional configuration on top of CSS Modules */
/*
module.exports = withCSS({
cssModules: true,
webpack: function (config) {
return config;
}
});
*/
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lazytai/next-with-antd.git
git@gitee.com:lazytai/next-with-antd.git
lazytai
next-with-antd
next-with-antd
master

搜索帮助