sdli / next-antd-aza-less Goto Github PK
View Code? Open in Web Editor NEWA less loader tool for next.js and antd intergration
A less loader tool for next.js and antd intergration
按照你的方法,antd的less可以避免css-modules,但我现在想引入全局的样式供所有页面使用,有好的办法吗?求指导
if (typeof require !== 'undefined') {
require.extensions['.less'] = (file) => {}
}
I read the source code, but i don't understand the difference with @zeit/next-less
?
What is this plugin target?
Is it only work for antd
less style?
thanks for this workaround!
i think less-loader
should prolly be a peer dep of this plugin since it's used by the plugin but not required directly.
Build error occurred
{ D:\(WEB)\react\proscenic-next\node_modules\antd\lib\style\index.less:1
(function (exports, require, module, __filename, __dirname) { @import './themes/index';
^
SyntaxError: Invalid or unexpected token
at new Script (vm.js:74:7)
at createScript (vm.js:246:10)
at Object.runInThisContext (vm.js:298:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18) type: 'SyntaxError' }
Creating an optimized production build .Automatically optimizing pages .npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: next build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
i configure my project according the document, but the antd css is still no effect.
and according this document configure (https://www.yuque.com/steven-kkr5g/aza/ig3x9w) is still no effect(ps: 我按照配置文档里两种配置配置后,antd 的样式依然没有生效) 。
I would be very grateful if you could help me
When I try to run next build
on the docker container below error appear.
`
Build error occurred
{ /usr/src/app/node_modules/antd/lib/style/index.less:1
@import './themes/default';
^
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:721:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/usr/src/app/node_modules/antd/lib/button/style/index.js:3:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) type: 'SyntaxError', '$error': '$error' }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
`
By the way, this error doesn't appear when I run next start.
Note: I have set up the project according to the document
如果想overwrite antd默认样式怎么操作呢~
谢谢~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.