razzle-plugin-antd

0.3.5 • Public • Published

razzle-plugin-antd

a plugin for razzle which let us can use ant-design && less.

how to use

yarn add razzle-plugin-antd
// razzle.config.js
module.exports = {
  plugins: ['antd']
}

// or
module.exports = {
  plugins: [
    {
      name: 'antd',
      options: {
        theme: {}, // antd theme config default {}
        style: true, // babel-plugin-import true || 'css'
        openBabelImport: true, // if open babel-plugin-import
        supportLess: true, // if open less support
        css: { // css-load config
          dev: {
            sourceMap: true,
            importLoaders: 1,
            modules: false,
          },
          pro: {
            sourceMap: false,
            importLoaders: 1,
            minimize: true,
            modules: false
          }
        },
        postcss: { // post-css config
          dev: {
            ident: 'postcss',
            sourceMap: true
          },
          pro: {
            dent: 'postcss',
            sourceMap: false
          },
          plugins: [
            require('postcss-flexbugs-fixes'),
            autoprefixer({
              browsers: [
                '>1%',
                'last 4 versions',
                'Firefox ESR',
                'not ie < 9', // React doesn't support IE8 anyway
              ],
              flexbox: 'no-2009',
            }),
          ]
        },
        less: { // less-loader config
          dev: {
            sourceMap: true,
            includePaths: [paths.appNodeModules],
          },
          pro: {
            sourceMap: false,
            includePaths: [paths.appNodeModules],
          }
        },
        styles: {} // style-loader config default {}
    }
  ]
}

notice

I think this is still not a good solution. If you have a better solution, please remind me.

Readme

Keywords

none

Package Sidebar

Install

npm i razzle-plugin-antd

Weekly Downloads

21

Version

0.3.5

License

MIT

Unpacked Size

7.03 kB

Total Files

7

Last publish

Collaborators

  • huangteng