Add document to with-ant-design-less example
See original GitHub issuePlease add some document why we add following configuration to less. check https://github.com/zeit/next.js/issues/7957 for details, I also create a reproduction demo
if (isServer) {
const antStyles = /antd\/.*?\/style.*?/;
const origExternals = [...config.externals];
config.externals = [
(context, request, callback) => {
if (request.match(antStyles)) {
return callback();
};
if (typeof origExternals[0] === 'function') {
origExternals[0](context, request, callback);
} else {
callback()
}
},
...(typeof origExternals[0] === 'function' ? [] : origExternals),
];
config.module.rules.unshift({
test: antStyles,
use: 'null-loader',
});
}
- Why less files of
Antd
matching/antd\/.*?\/style.*?/
are excluded from server webpack? - Why they are excluded by webpack externals option, exclude them again by null-loader?
- Since they are excluded why they are still loaded? that is why I have following error.
/Users/john/www/acme-admin-ui/node_modules/antd/lib/style/index.less:1
@import './themes/index';
^
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:718:23)
at Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Object.require.extensions.<computed> [as .js] (/Users/john/www/acme-admin-ui/node_modules/ts-node/src/index.ts:529:44)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/Users/john/www/acme-admin-ui/node_modules/antd/lib/layout/style/layout/style/index.jsx:1:1)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Object.require.extensions.<computed> [as .js] (/Users/john/www/acme-admin-ui/node_modules/ts-node/src/index.ts:529:44)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/Users/john/www/acme-admin-ui/node_modules/@ant-design/pro-layout/lib/BasicLayout.js:10:1)
@ant-design/pro-layout/lib/BasicLayout.js
"use strict";
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
require("antd/lib/layout/style"); //@ant-design/pro-layout/lib/BasicLayout.js:10:1. this line requires layout style which is supposed to be excluded by webpack, `antd/lib/layout/style` matches the regular expression above, so "@import" should not be resolved.
var _layout = _interopRequireDefault(require("antd/lib/layout"));
require("./BasicLayout.less");
I did everything as the example, it doesn’t work in my enviroment, I search several hours, still don’t figure out.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Add document to with-ant-design-less example #9669 - GitHub
js:10:1. this line requires layout style which is supposed to be excluded by webpack, `antd/lib/layout/style` matches the regular expression ...
Read more >Insert a document in Word - Microsoft Support
Inserting a document · Click or tap where you want to insert the content of the existing document. · Go to Insert and...
Read more >uploading-document-instructions.pdf - WA DOL
(examples: è, é, ñ, &, *, #). How to upload a document. To upload your document: 1. Select the Add Files button.
Read more >Document Upload Descriptions and Examples - NMLS
DOCUMENT UPLOAD DESCRIPTIONS AND EXAMPLES. Below are descriptions and examples of the different types of documentation available for upload to NMLS.
Read more >How to Upload a New Document - Handshake Help Center
Uploaded documents can be resumes, cover letters, transcripts, work samples, or other documents requested by the employer.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
try this
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.