相关疑难解决方法(0)

NextJS - 导出被破坏(没有 CSS,没有 JS)

我正在使用 NextJS ( https://nextjs.org/ ) 9.0.6 版。

我的 next.config.js 看起来像这样:

/* eslint-disable */
const withLess = require("@zeit/next-less");
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(path.resolve(__dirname, "./assets/antd-custom.less"), "utf8")
);

module.exports = withLess({
  lessLoaderOptions: {
    javascriptEnabled: true,
    modifyVars: themeVariables // make your antd custom effective
  },
  webpack: (config, {
    isServer,
    defaultLoaders
  }) => {
    const originalEntry = config.entry;
    config.entry = async() => {
      const entries = await …
Run Code Online (Sandbox Code Playgroud)

html javascript yarnpkg next.js

10
推荐指数
3
解决办法
2082
查看次数

标签 统计

html ×1

javascript ×1

next.js ×1

yarnpkg ×1