Comments (7)
一样的,roadhog 支持 webpack.config.js
。
from roadhog.
那webpack.config.js 和 .roadhogrc 是同时配置使用的还是只能单独使用?
能给个现在版本的使用webpack.config.js的例子吗?
之前这么写的, 关闭了css moudle(不好用,不知道怎么和ui库配合使用,覆盖样式之类的)
const pxtorem = require('postcss-pxtorem');
const webpack = require('atool-build/lib/webpack');
module.exports = function(webpackConfig, env) {
webpackConfig.babel.plugins.push('transform-runtime');
// Support hmr
if (env === 'development') {
webpackConfig.devtool = '#eval';
webpackConfig.babel.plugins.push('dva-hmr');
} else {
webpackConfig.babel.plugins.push('dev-expression');
}
// Don't extract common.js and common.css
webpackConfig.plugins = webpackConfig.plugins.filter(function(plugin) {
return !(plugin instanceof webpack.optimize.CommonsChunkPlugin);
});
// Support antd
webpackConfig.babel.plugins.push(['import', {
libraryName: 'antd-mobile',
style: 'css'
}])
webpackConfig.externals ={
'AMap': 'AMap',
'wx': 'wx',
'OSS': 'OSS'
}
webpackConfig.postcss.push(pxtorem({
rootValue: 100,
propWhiteList: [],
}));
return webpackConfig;
};
from roadhog.
可以同时用的,webpack.config.js 的配置在 .roadhogrc 之后。
from roadhog.
有问题再 reopen
from roadhog.
@sorrycc 有个问题: .roadhogrc 中如何配置 pxtorem。
@semicoder 贴出来的代码我试用了下发现有 bug: webpackConfig.postcss 的类型是 function,导致 push 方法报错,这个可能是哪里的问题?
roadhog的版本是 0.5.2
from roadhog.
@jozhi 用 extraPostCSSPlugins 配置。
from roadhog.
@sorrycc 没头没尾的有这么一句真的是让哀家不知所措,不知道怎么往项目上用。 如果能贴出来完整的配置会不会更好一点。。
目前临时解决方案 #134 ,如果可以请尽快修复一下。
from roadhog.
Related Issues (20)
- 从1.x升级到2.x 运行时babel报错
- 升级到2.x之后eslint报错
- 加入websocket代理后crash HOT 1
- 打包后放到服务器上的时候不加载样式,本地却没有问题 HOT 3
- babel-loader isn’t transpiling Quill’s modules because they're inside node_modules/
- 升级2.0以后,libraryTarget没有了,怎么做组件了?在线等 HOT 3
- 指定启动端口无效
- 普通的js,非js组件,如何获得model的值,虽然能挂载window,但是这方法好low
- Module build failed:var content = require("!!../../../../css-loader/index.js!../../../../postcss-loader/lib/index.js!../../../../less-loader/dist/cjs.js??ref--13-3!./index.less"); ^ Unrecognised input in C:\workSpace\git\dap\node_modules\antd\es\auto-complete\style\index.less (line 2, column 12) HOT 1
- less mixins 调用函数直接取变量值时,编译报错 unrecognised input HOT 1
- libraryTarget 、library配置一直报错,期望给出示例
- extraBabelIncludes未应用extraBabelPlugins规则造成无法Uglify的问题
- 2.1.0版本的roadhog怎么设置headers、library、libraryTarget、jsonpFunction
- dva-hmr热更新问题
- 打包 Uglifyjs 报错问题
- 维护一个老的roadhog 1.x项目, 发现配置publicPath不生效. HOT 1
- 构建报UglifyJs错误 HOT 4
- 1.3.1升级到2.4.9报错,Can't resolve '@babel/runtime/helpers/esm/extends' HOT 1
- bug
- 2.x版本的roadhog如何配置postcss-px-to-viewport或者postcss-pxtorem呀? 试了下配置不生效
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from roadhog.