Skip to content

Razzle with Bit.dev #1312

Answered by JoshK2
sebay00 asked this question in Q&A
May 26, 2020 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

No needs to fork the compiler!
Just add the following configuration to your razzle.config.js file:

const nodeExternals = require('webpack-node-externals')

module.exports = {
  modify: (config, { target, dev }) => {
    config.externals =
      target === 'node'
        ? [
            nodeExternals({
              whitelist: [
                dev ? 'webpack/hot/poll?300' : null,
                /\.(eot|woff|woff2|ttf|otf)$/,
                /\.(svg|png|jpg|jpeg|gif|ico)$/,
                /\.(mp4|mp3|ogg|swf|webp)$/,
                /\.(css|scss|sass|sss|less)$/,
                /^@bit\/(.*)/,
              ].filter(Boolean),
            }),
          ]
        : []
    return config
  }…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@stevepepple
Comment options

Answer selected by fivethreeo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1312 on October 06, 2020 11:57.