Skip to content
New issue

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

Dispatch event after building webpack config #1077

Merged
merged 1 commit into from Aug 3, 2017

Conversation

jthomaschewski
Copy link
Contributor

This implements #1006

Allows the following syntax to freely modify the webpack config without the limitations of the webpack-merge smart merge.

Example:

// webpack.mix.js

Mix.listen('configReady', (webpackConfig) => {

  // remove original rule
  webpackConfig.module.rules = webpackConfig.module.rules.filter(rule => String(rule.test) !== String(/\.s[ac]ss$/))

  // add modified rule
  webpackConfig.module.rules.push({
    test: /\.s[ac]ss$/,
    loaders: [
      {loader: 'style-loader'},
      {loader: 'css-loader', options: {sourceMap: true}},
      {loader: 'sass-loader', options: {sourceMap: true}},
    ],
  })

})

@JeffreyWay JeffreyWay merged commit 974ea87 into laravel-mix:master Aug 3, 2017
@jameshulse
Copy link
Contributor

It could be handy to document this feature (I can't find it from googling) as I think it is a common use-case to want the final webpack config for posting bug reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants