Commit 799b392b by liguokang

feat: 🎨

parent f3628c28
...@@ -2,11 +2,20 @@ ...@@ -2,11 +2,20 @@
* @Author: liguokang * @Author: liguokang
* @Date: 2021-07-27 20:25:45 * @Date: 2021-07-27 20:25:45
* @LastEditors: liguokang * @LastEditors: liguokang
* @LastEditTime: 2021-07-27 20:31:33 * @LastEditTime: 2021-07-29 16:02:23
* @Description: * @Description:
* @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有 * @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有
*/ */
module.exports = { module.exports = {
presets: [['next/babel']], presets: ['next/babel', '@babel/preset-react'],
plugins: [['import', { libraryName: 'antd', style: true }]], plugins: [
[
'import',
{
libraryName: 'antd',
// true 的时候才会编译less
style: true,
},
],
],
}; };
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# next.js # next.js
/.next/ /.next/
/out/ /dist/
# production # production
/build /build
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: liguokang * @Author: liguokang
* @Date: 2021-07-14 20:36:28 * @Date: 2021-07-14 20:36:28
* @LastEditors: liguokang * @LastEditors: liguokang
* @LastEditTime: 2021-07-29 14:43:14 * @LastEditTime: 2021-07-29 16:05:28
* @Description: * @Description:
* @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有 * @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -40,6 +40,14 @@ module.exports = withLessExcludeAntd({ ...@@ -40,6 +40,14 @@ module.exports = withLessExcludeAntd({
}, },
}), }),
); );
if (config.externals) {
const includes = [/antd/];
config.externals = config.externals.map((external) => {
if (typeof external !== 'function') return external;
return (ctx, req, cb) =>
includes.find((include) => (req.startsWith('.') ? include.test(path.resolve(ctx, req)) : include.test(req))) ? cb() : external(ctx, req, cb);
});
}
return config; return config;
}, },
}); });
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build && next export -o dist && npm run nd",
"export": "npm run build && next export", "export": "npm run build && next export",
"start": "next start", "start": "next start",
"build:dev": "cross-env DEPLOY_ENV=dev npm run build", "build:dev": "cross-env DEPLOY_ENV=dev npm run build",
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
"precommit": "pretty-quick --staged" "precommit": "pretty-quick --staged"
}, },
"dependencies": { "dependencies": {
"@babel/core": "^7.14.8",
"@babel/preset-react": "^7.14.5",
"@zeit/next-css": "^1.0.1", "@zeit/next-css": "^1.0.1",
"@zeit/next-less": "^1.0.1", "@zeit/next-less": "^1.0.1",
"antd": "^4.16.9", "antd": "^4.16.9",
......
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
* @Author: zhujiapeng * @Author: zhujiapeng
* @Date: 2021-06-02 15:13:37 * @Date: 2021-06-02 15:13:37
* @LastEditors: liguokang * @LastEditors: liguokang
* @LastEditTime: 2021-07-14 20:40:05 * @LastEditTime: 2021-07-29 16:10:19
* @Description: 描述一下咯 * @Description: 描述一下咯
* @Copyright: ©2021 杭州杰竞科技有限公司 版权所有 * @Copyright: ©2021 杭州杰竞科技有限公司 版权所有
*/ */
import React from 'react';
function About() { function About() {
return <div>About</div> return <div>About</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment