Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Commit

Permalink
Merge pull request #30 from oliviertassinari/improve-warnings
Browse files Browse the repository at this point in the history
fix: improve the error message
  • Loading branch information
oliviertassinari authored May 22, 2017
2 parents 1f80330 + 1c40283 commit e3a6547
Show file tree
Hide file tree
Showing 7 changed files with 5,415 additions and 17 deletions.
1 change: 1 addition & 0 deletions docs/node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/webpack/developmentConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
hot: true,
historyApiFallback: true,
port: PORT,
disableHostCheck: true, // For security checks, no need here.

// webpack-dev-middleware options.
stats: {
Expand Down
4 changes: 4 additions & 0 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,37 +41,37 @@
"webpack": "1 || ^2 || ^2.2.0-rc"
},
"devDependencies": {
"autoprefixer": "^6.7.2",
"autoprefixer": "^7.1.1",
"babel-cli": "^6.23.0",
"babel-core": "^6.23.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.3.0",
"babel-loader": "^7.0.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-1": "^6.16.0",
"chai": "^3.5.0",
"css-loader": "^0.26.1",
"css-loader": "^0.28.2",
"eslint": "^3.15.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-config-airbnb": "^15.0.1",
"eslint-plugin-babel": "^4.0.0",
"eslint-plugin-flowtype": "^2.29.2",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.0",
"eslint-plugin-jsx-a11y": "^5.0.3",
"eslint-plugin-mocha": "^4.8.0",
"eslint-plugin-react": "^6.8.0",
"eslint-plugin-react": "^7.0.1",
"extract-text-webpack-plugin": "^2.0.0-rc.3",
"flow-bin": "^0.39.0",
"flow-bin": "^0.46.0",
"force-case-sensitivity-webpack-plugin": "^0.2.1",
"html-webpack-plugin": "^2.28.0",
"mocha": "^3.2.0",
"node-sass": "^4.5.0",
"postcss-loader": "^1.3.0",
"postcss-loader": "^2.0.5",
"react": "^15.4.1",
"react-dom": "^15.4.1",
"react-hot-loader": "^3.0.0-beta.6",
"sass-loader": "^6.0.0",
"style-loader": "^0.13.1",
"style-loader": "^0.18.0",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.3.0"
}
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ export default class ServiceWorkerPlugin {

if (!asset) {
compilation.errors.push(
new Error('ServiceWorkerPlugin: ServiceWorker entry is not found in output assets'),
new Error('ServiceWorkerPlugin: the `entry` option is incorrect.'),
);

return Promise.reject();
callback();
return;
}

const jsonStats = compilation.getStats().toJson({
Expand Down Expand Up @@ -180,7 +180,7 @@ export default class ServiceWorkerPlugin {

const templatePromise = this.options.template(serviceWorkerOption);

return templatePromise.then((template) => {
templatePromise.then((template) => {
const serviceWorkerOptionInline = JSON.stringify(serviceWorkerOption, null, minify ? 0 : 2);

const source = `
Expand Down
6 changes: 2 additions & 4 deletions src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ describe('ServiceWorkerPlugin', () => {
return serviceWorkerPlugin
.handleEmit(compilation, {
options: {},
}, () => {})
.then(() => {
}, () => {
assert.strictEqual(compilation.assets[filename].source(), trim(`
var serviceWorkerOption = {
"assets": [
Expand Down Expand Up @@ -74,8 +73,7 @@ var serviceWorkerOption = {
return serviceWorkerPlugin
.handleEmit(compilation, {
options: {},
}, () => {})
.then(() => {
}, () => {
assert.strictEqual(compilation.assets[filename].source(), trim(`
var serviceWorkerOption = {
"bar": "foo",
Expand Down
Loading

0 comments on commit e3a6547

Please sign in to comment.