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

Deployment failure with own babelrc and webpack config #1118

Closed
Radzam opened this issue Feb 11, 2018 · 1 comment
Closed

Deployment failure with own babelrc and webpack config #1118

Radzam opened this issue Feb 11, 2018 · 1 comment

Comments

@Radzam
Copy link

Radzam commented Feb 11, 2018

When using external babelrc file, I'm getting various deployment errors. Can someone take a look and help identify what might be causing it?

.babelrc

{
    "plugins": [
        [
            "module-resolver",
            {
                "root": ["."],
                "alias": {
                    "styles": "./styles"
                },
                "cwd": "babelrc"
            }
        ],
        ["inline-react-svg"]
    ],
    "presets": ["next/babel"],
    "ignore": []
}

next.config.js

const path = require('path')
const glob = require('glob')

module.exports = {
  webpack: (config, { dev }) => {
    config.module.rules.push(
      {
        test: /\.(css|scss)/,
        loader: 'emit-file-loader',
        options: {
          name: 'dist/[path][name].[ext]'
        }
      },
      {
        test: /\.css$/,
        use: ['babel-loader', 'raw-loader', 'postcss-loader']
      },
      {
        test: /\.s(a|c)ss$/,
        use: [
          'babel-loader',
          'raw-loader',
          'postcss-loader',
          {
            loader: 'sass-loader',
            options: {
              includePaths: ['styles', 'node_modules']
                .map(d => path.join(__dirname, d))
                .map(g => glob.sync(g))
                .reduce((a, c) => a.concat(c), [])
            }
          }
        ]
      }
    )
    return config
  }
}
@leo
Copy link
Contributor

leo commented Nov 13, 2018

Thank you so much for the effort you have put into this issue! 😊

However, since we completely re-worked the entire codebase of Now CLI and this issue does not apply to the new code anymore, I'm closing it now.

You can read more about our biggest release yet here: https://zeit.co/blog/now-2

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

No branches or pull requests

2 participants