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

NPM install missing ./dist/query-builder.css #7

Open
JamesMcGuigan opened this issue May 14, 2017 · 0 comments
Open

NPM install missing ./dist/query-builder.css #7

JamesMcGuigan opened this issue May 14, 2017 · 0 comments

Comments

@JamesMcGuigan
Copy link

I was investigating this tool for use in an ES6 project with a custom webpack/babel config (without babel "es2015").

Attempting to import your npm module resulted in a compile time error due to a missing file, with the error focused on this line

./dist/query-builder.js:4 import './query-builder.css';

There are a few possible fixes:

  • Copy ../src/query-builder.css ../dist/query-builder.js as part of the prepublish npm script
    package.json
    "compile": "babel src --out-dir dist && cp ../src/query-builder.css ../dist/query-builder.js",
  • Change the ES6 css import statement to go up a directory first, so the dist folder can always import the css file directly from the ./src/ directory

./dist/query-builder.js:4

import '../src/query-builder.css';
  • Change the package json file to directly reference the uncompiled ./src/ directory for external webpack ES6 imports, rather than pointing to the ./dist/ directory which is for those who lack a external buildchain

package.json

  "main": "src/query-builder.js",
@JamesMcGuigan JamesMcGuigan changed the title Missing ./dist/query-builder.css NPM install missing ./dist/query-builder.css May 14, 2017
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

1 participant