Skip to content

Prevent output file content changes between compiles #101

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

Merged
merged 1 commit into from
Jun 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export default ({
let styleImportName: string;

if (path.node.specifiers.length === 0) {
// eslint-disable-next-line no-process-env
styleImportName = process.env.NODE_ENV === 'test' ? 'random-test' : 'random-' + Math.random();
// use imported file path as import name
styleImportName = path.node.source.value;
} else if (path.node.specifiers.length === 1) {
styleImportName = path.node.specifiers[0].local.name;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import _getClassName from 'babel-plugin-react-css-modules/dist/browser/getClassN
import './bar.css';

const _styleModuleImportMap = {
'random-test': {
'./bar.css': {
'a': 'bar__a'
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const _styleModuleImportMap = {
'bar': {
'a-b': 'bar__a-b'
},
'random-test': {
'./foo.css': {
'a-b': 'foo__a-b'
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const _styleModuleImportMap = {
'bar': {
'a-b': 'bar__a-b'
},
'random-test': {
'./foo.css': {
'a-b': 'foo__a-b'
}
};
Expand Down