1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-22 16:29:09 +01:00

Change webpack to only copy the html files to popup/app. Update readme with more instructions for building. (#336)

This commit is contained in:
Oscar Hinton 2017-10-29 13:58:50 +01:00 committed by Kyle Spearrin
parent 5439a2b33e
commit 77f9270131
3 changed files with 23 additions and 8 deletions

View File

@ -27,10 +27,10 @@ The bitwarden browser extension is written using the Chrome Web Extension API an
By default the extension is targeting the production API. If you are running the [Core](https://github.com/bitwarden/core) API locally, you'll need to switch the extension to target your local instance. Open `src/services/apiService.js` and set `self.baseUrl` and `self.identityBaseUrl` to your local API instance (ex. `http://localhost:5000`).
Then run the following commands:
- `npm install`
- `gulp build`
- `npm run dev:watch`
```bash
npm install
npm run dev:watch
```
You can now load the extension into your browser through the browser's extension tools page:
@ -42,6 +42,17 @@ You can now load the extension into your browser through the browser's extension
1. Type `about:debugging` in your address bar to bring up the add-ons page.
2. Click the `Load Temporary Add-on` button, navigate to the `dist/manifest.json` file, and "Open".
### Release
To build the the extension for production the following commands should be run:
```bash
npm run prod
gulp dist:[browser]
```
Where `[browser]` is the web browser to target. Currently the following web browsers are supported: `chrome`, `edge`, `firefox` and `opera`.
# Contribute
Code contributions are welcome! Please commit any pull requests against the `master` branch. Learn more about how to contribute by reading the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.

View File

@ -3,9 +3,9 @@
"version": "0.0.0",
"scripts": {
"start:firefox": "web-ext run --source-dir ./dist/",
"dev": "webpack --config webpack.dev.js",
"dev:watch": "webpack --config webpack.dev.js --watch",
"prod": "webpack --config webpack.prod.js"
"dev": "gulp build && webpack --config webpack.dev.js",
"dev:watch": "gulp build && webpack --config webpack.dev.js --watch",
"prod": "gulp build && webpack --config webpack.prod.js"
},
"devDependencies": {
"angular": "1.6.6",

View File

@ -73,7 +73,11 @@ module.exports = {
new CopyWebpackPlugin([
// Temporarily copy the whole app folder, can be removed once
// the templates uses template rather than using templateUrl.
{ from: './src/popup/app', to: 'popup/app' },
{
context: 'src/popup/app',
from: '**/*.html',
to: 'popup/app'
},
'./src/manifest.json',
{ from: './src/_locales', to: '_locales' },
{ from: './src/edge', to: 'edge' },