Skip to content

Commit

Permalink
Use npm script to build and pack extension (#107)
Browse files Browse the repository at this point in the history
* Use npm script to build and pack extension

* Fix archive creation

* Do not copy manifest file

The manifest is already copied by the npm script task `chrome-manifest`
  • Loading branch information
stefanbuck authored and josephfrazier committed Jun 27, 2016
1 parent ea30b42 commit 6d94101
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 66 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Expand Up @@ -2,9 +2,4 @@ node_modules
npm-debug.log

dist/

chrome/*
!chrome/manifest.json

firefox/*
!firefox/manifest.json
out/
File renamed without changes.
29 changes: 0 additions & 29 deletions chrome/manifest.json

This file was deleted.

21 changes: 13 additions & 8 deletions package.json
Expand Up @@ -11,14 +11,18 @@
"pretest": "npm run lint",
"test": "karma start",
"test:watch": "karma start --no-single-run --auto-watch",
"build": "webpack",
"build:watch": "webpack --watch",
"build-chrome": "webpack --output-path chrome",
"build-firefox": "webpack --output-path firefox",
"open-firefox": "web-ext run --source-dir firefox",
"dist-chrome": "webpack -p --config webpack.dist.config.js --dist=chrome",
"dist-firefox": "webpack -p --config webpack.dist.config.js --dist=firefox",
"dist-all": "npm run dist-chrome && npm run dist-firefox"
"chrome-manifest": "mkdir -p dist && json -e 'delete this.applications; this.permissions.shift()' < assets/manifest.json > dist/manifest.json",
"chrome-build": "npm run chrome-manifest && webpack",
"chrome-dist": "npm run chrome-build -- -p",
"chrome-watch": "npm run chrome-manifest && webpack --watch",
"chrome-pack": "npm run chrome-dist && mkdir -p out && zip -rj out/chrome-octolinker-$npm_package_version.zip dist",
"firefox-manifest": "mkdir -p dist && cp assets/manifest.json dist/manifest.json",
"firefox-build": "npm run firefox-manifest && webpack",
"firefox-dist": "npm run firefox-build -- -p",
"firefox-watch": "npm run firefox-manifest && webpack --watch",
"firefox-pack": "npm run firefox-dist && mkdir -p out && zip -rj out/firefox-octolinker-$npm_package_version.zip dist/",
"firefox-open": "npm run firefox-build && web-ext run --source-dir dist",
"pack-repo": "mkdir -p out && zip -r out/octolinker-repository-$npm_package_version.zip * --exclude dist/\\* out/\\* node_modules/\\*"
},
"dependencies": {
"JSONPath": "^0.11.2",
Expand All @@ -41,6 +45,7 @@
"copy-webpack-plugin": "^3.0.1",
"eslint": "^1.10.3",
"eslint-config-airbnb": "2.1.1",
"json": "^9.0.4",
"json-loader": "^0.5.4",
"karma-fixture": "^0.2.5",
"karma-html2js-preprocessor": "^0.1.0",
Expand Down
6 changes: 4 additions & 2 deletions webpack.config.js
Expand Up @@ -7,13 +7,15 @@ module.exports = {
},
devtool: 'source-map',
output: {
path: 'chrome',
path: 'dist',
filename: '[name].js',
},
plugins: [
new CopyWebpackPlugin([
{ from: 'assets' },
]),
], {
ignore: ['manifest.json'],
}),
],
module: {
loaders: [
Expand Down
21 changes: 0 additions & 21 deletions webpack.dist.config.js

This file was deleted.

0 comments on commit 6d94101

Please sign in to comment.