question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not picking up config?

See original GitHub issue

Probably something I did wrong though I followed a guide.

// craco.config.js
const path = require("path")
module.exports = {
  output: {
    chunkFilename: '[id]CCCCCC.js',
    path: path.resolve(__dirname, 'dist')
  }
}
//package.json
  "scripts": {
    "build": "craco build",
  },

Then I tried to build it:

C:\dev\projects\myApp>npm run build

> myApp build C:\dev\projects\myApp
> craco build

  540.62 KB  build\static\js\main.97530591.chunk.js
  333.75 KB  build\static\js\2.4b6e91f0.chunk.js
  7.44 KB    build\static\css\main.0eb1ccc4.chunk.css
  775 B      build\static\js\runtime-main.9d14031a.js


But it still gets built into the build folder, not dist, and neither do chunks have CCCCCC in the name. I tried few other settings like filename, but also not picking up.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
bihongbin3027commented, Jul 3, 2020

craco.config settings:

module.exports = {
    webpack: {
    configure: {
      output: {
        path: path.resolve(__dirname, 'dist'),
        filename: '[name].js',
      },
    },
  },
}

It produced the build directory at the same time as the dist directory and produced an error:

File sizes after gzip:

ENOENT: no such file or directory, open ‘C:\Users\Admin\Desktop\ibfweb\build\run time-main.js’ error Command failed with exit code 1.

2reactions
patricklafrancecommented, Feb 10, 2020

If you still want to do it, I suggest you override the webpack config manually using:

module.exports = {
    webpack: {
        configure: { /* Any webpack configuration options: https://webpack.js.org/configuration */ },
        configure: (webpackConfig, { env, paths }) => { return webpackConfig; }
    }
}

The following should work:

module.exports = {
    webpack: {
        configure: {
               output: {
                    chunkFilename: '[id]CCCCCC.js',
                    path: path.resolve(__dirname, 'dist')
               }
        }
    }
}

More info at: https://github.com/gsoft-inc/craco/blob/master/packages/craco/README.md#configuration-overview

Read more comments on GitHub >

github_iconTop Results From Across the Web

flake8 not picking up config file - Stack Overflow
For anyone running into this more recently: I turns out flake8 4.x no longer supports loading .config/flake8 , and seems to have no...
Read more >
Remark not picking up configuration #187 - GitHub
@areohbe Correct, remark picks up configuration files from the file and up, but your package.json and .remarkrc are in a different path.
Read more >
Troubleshoot AWS Config rules that don't work
Various issues can cause managed AWS Config rules to not work, including permissions, resource scope, or configuration change items.
Read more >
Logrotate not picking up or acting on new configuration file
It appears that logrotate works using the logrotate.status file. In this status file, the log's modified date is marked down.
Read more >
Troubleshooting your configuration - Home Assistant
Perhaps an integration is not showing up or is acting strangely. ... Home Assistant will print out the configuration directory it is using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found