Giter Site home page Giter Site logo

Comments (14)

Kaijun avatar Kaijun commented on June 17, 2024 20

找了半天没找到example,看了下源码:

发现正确的使用姿势是:定义 webpack.config.js 返回一个 function 接受两个参数 webpackConfig, env

module.exports = function (webpackConfig, env) {
    // 对roadhog默认配置进行操作,比如:
    if (env === 'development') {
        webpackConfig.plugins.push('...')
    }
    return webpackConfig;
}

from roadhog.

Kaijun avatar Kaijun commented on June 17, 2024 2

@weishijun14

不好意思回复晚了,希望还可以帮到你
参考上面的回复, 需要操作原有webpackConfig

使用sass-loader的话可能需要去掉原有的less-loader

参考默认配置

在自定义的 webpack.config.js 里:
需要删除默认配置 webpackConfig.module.loaders 数组里面关于css/less的loader引用,
然后 webpackConfig.module.loaders.push(sassLoader)

当然这样子违背了roadhog的初衷,请谨慎使用

from roadhog.

cater111 avatar cater111 commented on June 17, 2024 1

我们现在用roadhog出现一个问题,工程打包太慢。是因为什么配置的原因吗?打开debug模式,原来几个小时,瞬间3分钟就打完了。但是感觉不能上生产。有什么方式可以加快速度吗。比如说第三方库与业务代码分离等。用roadhog怎么配置呀?求指导,万分感谢

from roadhog.

sorrycc avatar sorrycc commented on June 17, 2024

from roadhog.

sorrycc avatar sorrycc commented on June 17, 2024

from roadhog.

sorrycc avatar sorrycc commented on June 17, 2024

支持 es6,会用 babel-register 进行 transform。

from roadhog.

sorrycc avatar sorrycc commented on June 17, 2024

image

from roadhog.

sorrycc avatar sorrycc commented on June 17, 2024

image

from roadhog.

Kaijun avatar Kaijun commented on June 17, 2024

请问使用 webpack 配置,是一个和 roadhog 默认配置 merge 的操作,还是完全根据 webpack.conf.js 配置的跑?

from roadhog.

terminalqo avatar terminalqo commented on June 17, 2024

@Kaijun 请问下我想使用sass-loader 应该如何写?谢谢

from roadhog.

terminalqo avatar terminalqo commented on June 17, 2024

@Kaijun 明白了!谢谢!!

from roadhog.

yeluolei avatar yeluolei commented on June 17, 2024

强烈需求可以配置css loader。。 更改现有的css实现太麻烦了

from roadhog.

afc163 avatar afc163 commented on June 17, 2024
module.exports = function (webpackConfig, env) {
    // 对roadhog默认配置进行操作,比如:
    if (env === 'development') {
        webpackConfig.plugins.push('...')
    }
+   return webpackConfig;
}

from roadhog.

fsiaonma avatar fsiaonma commented on June 17, 2024

from roadhog.

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.