razzle-plugin-antd
v0.3.5
Published
razzle plugin for antd
Downloads
11
Readme
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.