forked from bwinton/SnoozeTabs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a build process using rollup & npm scripts
- `npm run {start,build,watch}` scripts for dev convenience, plus some more commands to make it more manageable - Move source files into `src/`; extension now assembled in `dist/` - Add moment dependency, remove vendor script version - Tweaks to use import from popup & background scripts - Add babel & rollup dev-dependencies - Add myself to package.json contributors
- Loading branch information
Showing
19 changed files
with
82 additions
and
1,244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.DS_Store | ||
profile.testing/ | ||
dist/ | ||
node_modules | ||
*.zip | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,26 @@ | |
"description": "An add-on to let you snooze your tabs for a while.", | ||
"version": "1.0.0", | ||
"author": "Blake Winton <[email protected]>", | ||
"contributors": [ | ||
"Les Orchard <[email protected]> (http://lmorchard.com/)" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/bwinton/SnoozeTabs/issues" | ||
}, | ||
"devDependencies": { | ||
"babel-plugin-external-helpers": "^6.18.0", | ||
"babel-preset-es2015": "^6.18.0", | ||
"babel-preset-react": "^6.16.0", | ||
"babel-preset-stage-0": "^6.16.0", | ||
"eslint": "^3.10.2", | ||
"npm-run-all": "^3.1.2", | ||
"onchange": "^3.2.0", | ||
"rollup": "^0.36.4", | ||
"rollup-plugin-babel": "^2.6.1", | ||
"rollup-plugin-commonjs": "^5.0.5", | ||
"rollup-plugin-node-globals": "^1.1.0", | ||
"rollup-plugin-node-resolve": "^2.0.0", | ||
"rollup-plugin-replace": "^1.1.1", | ||
"web-ext": "^1.4.0" | ||
}, | ||
"homepage": "https://github.com/bwinton/SnoozeTabs#readme", | ||
|
@@ -24,9 +39,20 @@ | |
"url": "git+https://github.com/bwinton/SnoozeTabs.git" | ||
}, | ||
"scripts": { | ||
"build": "web-ext build -a .", | ||
"start": "npm run build && npm-run-all --parallel watch run", | ||
"build": "npm run clean && npm run copy:assets && npm run bundle:js && npm run package", | ||
"watch": "onchange src -- npm run build", | ||
"run": "web-ext run -s dist --firefox=firefoxdeveloperedition", | ||
"clean": "rm -rf dist && mkdir dist", | ||
"copy:assets": "cp -rnv src/{manifest.json,lib,icons,popup} dist/", | ||
"bundle:js": "rollup -c --environment entry:background && rollup -c --environment entry:popup/snooze-content", | ||
"package": "web-ext build -s dist -a .", | ||
"lint": "eslint . && web-ext lint", | ||
"prebuild": "npm run lint", | ||
"test": "web-ext run" | ||
"test": "npm run build && web-ext run -s dist" | ||
}, | ||
"dependencies": { | ||
"moment": "^2.17.1", | ||
"react": "^15.4.1", | ||
"react-dom": "^15.4.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import babel from 'rollup-plugin-babel' | ||
import cjs from 'rollup-plugin-commonjs' | ||
import globals from 'rollup-plugin-node-globals' | ||
import replace from 'rollup-plugin-replace' | ||
import resolve from 'rollup-plugin-node-resolve' | ||
|
||
export default { | ||
entry: `src/${process.env.entry}.js`, | ||
dest: `dist/${process.env.entry}.js`, | ||
format: 'iife', | ||
plugins: [ | ||
babel({ | ||
babelrc: false, | ||
exclude: 'node_modules/**', | ||
presets: [ [ 'es2015', { modules: false } ], 'stage-0', 'react' ], | ||
plugins: [ 'external-helpers' ] | ||
}), | ||
cjs({ | ||
exclude: 'node_modules/process-es6/**', | ||
}), | ||
globals(), | ||
replace({ 'process.env.NODE_ENV': '"development"' }), | ||
resolve({ | ||
browser: true, | ||
main: true | ||
}) | ||
], | ||
sourceMap: false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters