Skip to content

Commit

Permalink
Use css-modules-require-hook instead of babel-plugin-webpack-loaders
Browse files Browse the repository at this point in the history
due to postcss-loader breaks webpack-loaders plugin, the plugin not active maintenance, and we are ready to migrate to webpack 2.
  • Loading branch information
jhen0409 committed Mar 8, 2017
1 parent 48ac015 commit 0538532
Show file tree
Hide file tree
Showing 4 changed files with 1,416 additions and 1,255 deletions.
9 changes: 1 addition & 8 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
"presets": ["es2015", "stage-0", "react"],
"plugins": ["add-module-exports", "transform-decorators-legacy", "transform-runtime"],
"env": {
"test": {
"plugins": [
["webpack-loaders", { "config": "webpack/test.config.js", "verbose": false }]
]
}
}
"plugins": ["add-module-exports", "transform-decorators-legacy", "transform-runtime"]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"compress-keygen": "crx keygen",
"clean": "rimraf build/ dev/ *.zip *.crx",
"lint": "eslint app chrome test scripts webpack/*.js",
"test-e2e": "cross-env NODE_ENV=test mocha test/e2e",
"test-e2e": "cross-env NODE_ENV=test mocha -r ./test/setup-app test/e2e",
"test": "cross-env NODE_ENV=test mocha -r ./test/setup-app test/app"
},
"repository": {
Expand All @@ -34,7 +34,6 @@
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-decorators-legacy": "^1.2.0",
"babel-plugin-transform-runtime": "^6.5.2",
"babel-plugin-webpack-loaders": "^0.8.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-react-hmre": "^1.0.0",
Expand All @@ -46,6 +45,7 @@
"cross-env": "^3.1.3",
"crx": "^3.0.3",
"css-loader": "^0.25.0",
"css-modules-require-hook": "^4.0.5",
"eslint": "^3.9.1",
"eslint-config-airbnb": "^12.0.0",
"eslint-plugin-import": "^1.16.0",
Expand Down
7 changes: 7 additions & 0 deletions test/setup-app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { jsdom } from 'jsdom';
import hook from 'css-modules-require-hook';
import postCSSConfig from '../webpack/postcss.config';

global.document = jsdom('<!doctype html><html><body></body></html>');
global.window = document.defaultView;
global.navigator = global.window.navigator;

hook({
generateScopedName: '[name]__[local]___[hash:base64:5]',
prepend: postCSSConfig.plugins,
});
Loading

0 comments on commit 0538532

Please sign in to comment.