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

import without assign are not processed #90

Open
kentandersen opened this issue May 30, 2018 · 0 comments
Open

import without assign are not processed #90

kentandersen opened this issue May 30, 2018 · 0 comments

Comments

@kentandersen
Copy link

When importing files without assignment './styles.css', importPathFormatter is not executed and the import path is not changed.

When importing with assignment import styles from './styles.css', importPathFormatter is called as expected.


index.js

import './style.css';

export default function(n) {
  return n+1;
}

style.css

.abc {
  background: green;
}

Babel config

{
  "preprocessCss": "./scripts/precompile.js",
  "keepImport": true,
  "extensions": [".css", ".scss"],
  "generateScopedName": "[local]",
  "importPathFormatter": "./scripts/renameImports.js",
  "extractCss": {
    "dir": "./lib/",
    "relativeRoot": "./src/",
     "filename": "[path]/[name].css"
  }
}
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