Skip to content

File not found (ENOENT) for CSS source map using Bootstrap #42

Description

@admackin

I can't get sourcemap bundling working with Bootstrap's CSS, and after some investigation, it seems like it might be an Atomify bug.

It works fine in prodution mode, but I get an error such as the following when running with --debug:

   { [Error: ENOENT, no such file or directory '../node_modules/bootstrap/dist/css/bootstrap.css.map']
  errno: 34,
  code: 'ENOENT',
  path: '../node_modules/bootstrap/dist/css/bootstrap.css.map',
  syscall: 'open' }

The .map file does in fact exist (although I don't know what the path is relative to)

Here's a minimal package.json which you can use to reproduce the problem by running npm run bundle-dev:

{
  "name": "atomify-bootstrap-test",
  "version": "0.1.0",
  "description": "Debug Atomify problem with Bootstrap CSS",
  "scripts": {
    "bundle-dev": "atomify --debug",
    "bundle": "atomify"
  },
  "dependencies": {
    "atomify": "^6.1.0",
    "bootstrap": "^3.3.4",
    "resrcify": "^1.1.3"
  },
  "atomify": {
    "css": {
      "entry": "client/main.css",
      "output": "public/bundle.css"
    },
    "assets": {
      "dest": "public/assets",
      "prefix": "../assets/"
    }
  }
}

The only other file you need is a CSS file at 'client/main.css' containing the line

@import "bootstrap";

I should point out that invoking rework-npm from the CLI doesn't generate such errors (and there is indeed a source map in the CSS, although I haven't checked if it's accurate)

./node_modules/rework-npm-cli/index.js client/main.css -m -o public/bundle.css

(Not sure if this should be an Atomify bug, but I'll leave that up to the maintainers to decide)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions