From b32763b9e389454bd9091a3d0027629b5570e237 Mon Sep 17 00:00:00 2001 From: dengyun <37728280+dyun8080@users.noreply.github.com> Date: Thu, 23 Aug 2018 22:48:17 +0800 Subject: [PATCH] fix: SyntaxError @import "./themes/default" (#5018) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: bug 🐞 ![image](https://user-images.githubusercontent.com/37728280/44520939-05929380-a704-11e8-9e7e-7acbc08c6d39.png) --- examples/with-ant-design-less/.babelrc | 2 +- examples/with-ant-design-less/next.config.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/with-ant-design-less/.babelrc b/examples/with-ant-design-less/.babelrc index 5da018ea..2a55db99 100644 --- a/examples/with-ant-design-less/.babelrc +++ b/examples/with-ant-design-less/.babelrc @@ -6,7 +6,7 @@ "import", { "libraryName": "antd", - "style": "less" + "style": true } ] ] diff --git a/examples/with-ant-design-less/next.config.js b/examples/with-ant-design-less/next.config.js index a7fd69a5..426dc084 100644 --- a/examples/with-ant-design-less/next.config.js +++ b/examples/with-ant-design-less/next.config.js @@ -1,6 +1,11 @@ /* eslint-disable */ const withLess = require('@zeit/next-less') +// fix: prevents error when .less files are required by node +if (typeof require !== 'undefined') { + require.extensions['.less'] = (file) => {} +} + module.exports = withLess({ lessLoaderOptions: { javascriptEnabled: true,