We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`const { override, addWebpackAlias, addPostcssPlugins, } = require('customize-cra') const path = require('path')
const stylus = () => (config) => { const stylusLoader = { test: /.styl$/, use: [ { loader: 'style-loader', }, { loader: 'css-loader', options: { modules: { mode: 'local', // 样式名规则配置 localIdentName: '[local]--[hash:base64:5]', }, }, }, // .styl 20px -> 0.2rem { loader: 'px2rem-loader', options: { remUnit: 100 } }, { loader: 'stylus-loader', }, ], } const oneOf = config.module.rules.find((rule) => rule.oneOf).oneOf oneOf.unshift(stylusLoader) return config }
module.exports = { webpack: override( addWebpackAlias({ ['src']: path.resolve(__dirname, 'src'), }), stylus(), // 方式一:css文件20px -> 0.2rem addPostcssPlugins([ require("postcss-px2rem")({ remUnit: 100 }) ]), // 方式二:css文件20px -> 0.2rem // addPostcssPlugins([require('postcss-pxtorem')({ // rootValue: 100, // minPixelValue: 2, // propList: ['*'], // }),]), ) }`
Originally posted by @shuyanzi in #26 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
`const {
override,
addWebpackAlias,
addPostcssPlugins,
} = require('customize-cra')
const path = require('path')
const stylus = () => (config) => {
const stylusLoader = {
test: /.styl$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
modules: {
mode: 'local',
// 样式名规则配置
localIdentName: '[local]--[hash:base64:5]',
},
},
},
// .styl 20px -> 0.2rem
{
loader: 'px2rem-loader',
options: {
remUnit: 100
}
},
{
loader: 'stylus-loader',
},
],
}
const oneOf = config.module.rules.find((rule) => rule.oneOf).oneOf
oneOf.unshift(stylusLoader)
return config
}
module.exports = {
webpack: override(
addWebpackAlias({
['src']: path.resolve(__dirname, 'src'),
}),
stylus(),
// 方式一:css文件20px -> 0.2rem
addPostcssPlugins([
require("postcss-px2rem")({ remUnit: 100 })
]),
// 方式二:css文件20px -> 0.2rem
// addPostcssPlugins([require('postcss-pxtorem')({
// rootValue: 100,
// minPixelValue: 2,
// propList: ['*'],
// }),]),
)
}`
Originally posted by @shuyanzi in #26 (comment)
The text was updated successfully, but these errors were encountered: