Giter Club home page Giter Club logo

Comments (4)

prncc avatar prncc commented on June 8, 2024 1

I don't have experience with this, so I can't make a more meaningful comment without looking into it, but I do plan on exposing (and slightly modifying) internal utilities so that a static theme.scss file can be easily produced with the plugin. That should make the build non-dynamic, but compatible with a wider range of tools.

from antd-scss-theme-plugin.

PomeloMan avatar PomeloMan commented on June 8, 2024

My solution is to add the following code in the vue.config.js file.
Note: In view of #68, please ensure that the sass-loader version is below 8

module.exports = {
  ......
  configureWebpack: config => {
    config.plugins.push(new AntdScssThemePlugin('./theme.scss'))
  }
  chainWebpack(config) {
    const oneOfs = ['vue-modules', 'vue', 'normal-modules', 'normal']
    oneOfs.forEach(oneOf => {
      config.module.rule('less').oneOf(oneOf)
        .use('less-loader')
        .loader(AntdScssThemePlugin.themify('less-loader').loader)
        .options({
          sourceMap: !isProduction,
          javascriptEnabled: true
        })
      config.module.rule('sass').oneOf(oneOf)
        .use('sass-loader')
        .loader(AntdScssThemePlugin.themify('sass-loader').loader)
        .options({
          sourceMap: !isProduction,
          sassOptions: {
            indentedSyntax: true
          }
        })
      config.module.rule('scss').oneOf(oneOf)
        .use('sass-loader')
        .loader(AntdScssThemePlugin.themify('sass-loader').loader)
        .options({
          sourceMap: !isProduction,
          sassOptions: {
            indentedSyntax: true
          }
        })
    });
  }
  ......
}

from antd-scss-theme-plugin.

jsliu27 avatar jsliu27 commented on June 8, 2024

@PomeloMan Hi, Could you look at this problem for me? The configuration is the same as yours
error in ./node_modules/_ant-design-vue@1.6.2@ant-design-vue/es/style/index.less

Module build failed (from ./node_modules/_antd-scss-theme-plugin@1.0.8@antd-scss-theme-plugin/build/dist/lib/antdLessLoader.js):
Could not compile the SCSS theme file "./theme.scss" for the purpose of variable extraction. This is likely because it contains a Sass error.

@ ./node_modules/_ant-design-vue@1.6.2@ant-design-vue/es/style/index.less 4:14-300 14:3-18:5 15:22-308
@ ./node_modules/_ant-design-vue@1.6.2@ant-design-vue/es/button/style/index.js
@ ./src/config/antd-component-import.ts
@ ./src/main.ts
@ multi ./node_modules/_webpack-dev-server@3.11.0@webpack-dev-server/client?http://192.168.31.56:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts

from antd-scss-theme-plugin.

chuyuandu avatar chuyuandu commented on June 8, 2024

seems like that your sass file has syntax error
perhaps you use some new syntax that your sass-loader don't supports

from antd-scss-theme-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.