mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-29 12:55:21 +01:00
JIT builds for dev
This commit is contained in:
parent
dc35577564
commit
191042411c
@ -65,6 +65,7 @@ gulp.task('dist', ['dist:firefox', 'dist:chrome', 'dist:opera', 'dist:edge', 'di
|
|||||||
gulp.task('dist:firefox', (cb) => {
|
gulp.task('dist:firefox', (cb) => {
|
||||||
return dist('firefox', (manifest) => {
|
return dist('firefox', (manifest) => {
|
||||||
delete manifest['-ms-preload'];
|
delete manifest['-ms-preload'];
|
||||||
|
delete manifest.content_security_policy;
|
||||||
return manifest;
|
return manifest;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -73,6 +74,7 @@ gulp.task('dist:opera', (cb) => {
|
|||||||
return dist('opera', (manifest) => {
|
return dist('opera', (manifest) => {
|
||||||
delete manifest['-ms-preload'];
|
delete manifest['-ms-preload'];
|
||||||
delete manifest.applications;
|
delete manifest.applications;
|
||||||
|
delete manifest.content_security_policy;
|
||||||
return manifest;
|
return manifest;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -81,6 +83,7 @@ gulp.task('dist:chrome', (cb) => {
|
|||||||
return dist('chrome', (manifest) => {
|
return dist('chrome', (manifest) => {
|
||||||
delete manifest['-ms-preload'];
|
delete manifest['-ms-preload'];
|
||||||
delete manifest.applications;
|
delete manifest.applications;
|
||||||
|
delete manifest.content_security_policy;
|
||||||
delete manifest.sidebar_action;
|
delete manifest.sidebar_action;
|
||||||
delete manifest.commands._execute_sidebar_action;
|
delete manifest.commands._execute_sidebar_action;
|
||||||
return manifest;
|
return manifest;
|
||||||
@ -116,6 +119,7 @@ function edgeCopyBuild(source, dest) {
|
|||||||
delete manifest.applications;
|
delete manifest.applications;
|
||||||
delete manifest.sidebar_action;
|
delete manifest.sidebar_action;
|
||||||
delete manifest.commands._execute_sidebar_action;
|
delete manifest.commands._execute_sidebar_action;
|
||||||
|
delete manifest.content_security_policy;
|
||||||
return manifest;
|
return manifest;
|
||||||
})))
|
})))
|
||||||
.pipe(gulp.dest(dest))
|
.pipe(gulp.dest(dest))
|
||||||
|
23
package-lock.json
generated
23
package-lock.json
generated
@ -655,6 +655,29 @@
|
|||||||
"integrity": "sha1-n4NQykghRaRNARp1W4+zYj1gVEw=",
|
"integrity": "sha1-n4NQykghRaRNARp1W4+zYj1gVEw=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"angular2-template-loader": {
|
||||||
|
"version": "0.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/angular2-template-loader/-/angular2-template-loader-0.6.2.tgz",
|
||||||
|
"integrity": "sha1-wNROkP/w+sleiyPwQ6zaf9HFHXw=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"loader-utils": "0.2.17"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"loader-utils": {
|
||||||
|
"version": "0.2.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz",
|
||||||
|
"integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"big.js": "3.2.0",
|
||||||
|
"emojis-list": "2.1.0",
|
||||||
|
"json5": "0.5.1",
|
||||||
|
"object-assign": "4.1.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"angular2-toaster": {
|
"angular2-toaster": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/angular2-toaster/-/angular2-toaster-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/angular2-toaster/-/angular2-toaster-4.0.2.tgz",
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
"@types/tldjs": "1.7.1",
|
"@types/tldjs": "1.7.1",
|
||||||
"@types/webcrypto": "^0.0.28",
|
"@types/webcrypto": "^0.0.28",
|
||||||
"angular": "1.6.9",
|
"angular": "1.6.9",
|
||||||
|
"angular2-template-loader": "^0.6.2",
|
||||||
"angular-animate": "1.6.9",
|
"angular-animate": "1.6.9",
|
||||||
"angular-sweetalert": "1.1.2",
|
"angular-sweetalert": "1.1.2",
|
||||||
"angular-toastr": "2.1.1",
|
"angular-toastr": "2.1.1",
|
||||||
|
@ -78,6 +78,7 @@
|
|||||||
"webRequest",
|
"webRequest",
|
||||||
"webRequestBlocking"
|
"webRequestBlocking"
|
||||||
],
|
],
|
||||||
|
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
||||||
"commands": {
|
"commands": {
|
||||||
"autofill_login": {
|
"autofill_login": {
|
||||||
"suggested_key": {
|
"suggested_key": {
|
||||||
|
@ -24,41 +24,12 @@ const extractCss = new ExtractTextPlugin({
|
|||||||
allChunks: true,
|
allChunks: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const config = {
|
const moduleRules = [
|
||||||
entry: {
|
|
||||||
'popup/main': './src/popup/main.ts',
|
|
||||||
'background': './src/background.ts',
|
|
||||||
'content/autofill': './src/content/autofill.js',
|
|
||||||
'content/autofiller': './src/content/autofiller.js',
|
|
||||||
'content/notificationBar': './src/content/notificationBar.js',
|
|
||||||
'content/shortcuts': './src/content/shortcuts.js',
|
|
||||||
'notification/bar': './src/notification/bar.js',
|
|
||||||
'downloader/downloader': './src/downloader/downloader.ts',
|
|
||||||
'2fa/2fa': './src/2fa/2fa.ts',
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.tsx', '.ts', '.js'],
|
|
||||||
alias: {
|
|
||||||
jslib: path.join(__dirname, 'jslib/src'),
|
|
||||||
},
|
|
||||||
symlinks: false,
|
|
||||||
modules: [path.resolve('node_modules')],
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
filename: '[name].js',
|
|
||||||
path: path.resolve(__dirname, 'build'),
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
enforce: 'pre',
|
enforce: 'pre',
|
||||||
loader: 'tslint-loader',
|
loader: 'tslint-loader',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
|
|
||||||
loader: '@ngtools/webpack',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
test: /\.(html)$/,
|
test: /\.(html)$/,
|
||||||
loader: 'html-loader',
|
loader: 'html-loader',
|
||||||
@ -101,17 +72,12 @@ const config = {
|
|||||||
publicPath: '../',
|
publicPath: '../',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
],
|
];
|
||||||
},
|
|
||||||
plugins: [
|
const plugins = [
|
||||||
new CleanWebpackPlugin([
|
new CleanWebpackPlugin([
|
||||||
path.resolve(__dirname, 'build/*'),
|
path.resolve(__dirname, 'build/*'),
|
||||||
]),
|
]),
|
||||||
new AngularCompilerPlugin({
|
|
||||||
tsConfigPath: 'tsconfig.json',
|
|
||||||
entryModule: 'src/popup/app.module#AppModule',
|
|
||||||
sourceMap: true,
|
|
||||||
}),
|
|
||||||
// ref: https://github.com/angular/angular/issues/20357
|
// ref: https://github.com/angular/angular/issues/20357
|
||||||
new webpack.ContextReplacementPlugin(/\@angular(\\|\/)core(\\|\/)esm5/,
|
new webpack.ContextReplacementPlugin(/\@angular(\\|\/)core(\\|\/)esm5/,
|
||||||
path.resolve(__dirname, './src')),
|
path.resolve(__dirname, './src')),
|
||||||
@ -169,7 +135,52 @@ const config = {
|
|||||||
'ENV': JSON.stringify(ENV)
|
'ENV': JSON.stringify(ENV)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
],
|
];
|
||||||
|
|
||||||
|
if (ENV === 'production') {
|
||||||
|
moduleRules.push({
|
||||||
|
test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/,
|
||||||
|
loader: '@ngtools/webpack',
|
||||||
|
});
|
||||||
|
plugins.push(new AngularCompilerPlugin({
|
||||||
|
tsConfigPath: 'tsconfig.json',
|
||||||
|
entryModule: 'src/popup/app.module#AppModule',
|
||||||
|
sourceMap: true,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
moduleRules.push({
|
||||||
|
test: /\.ts$/,
|
||||||
|
loaders: ['ts-loader', 'angular2-template-loader'],
|
||||||
|
exclude: path.resolve(__dirname, 'node_modules'),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
entry: {
|
||||||
|
'popup/main': './src/popup/main.ts',
|
||||||
|
'background': './src/background.ts',
|
||||||
|
'content/autofill': './src/content/autofill.js',
|
||||||
|
'content/autofiller': './src/content/autofiller.js',
|
||||||
|
'content/notificationBar': './src/content/notificationBar.js',
|
||||||
|
'content/shortcuts': './src/content/shortcuts.js',
|
||||||
|
'notification/bar': './src/notification/bar.js',
|
||||||
|
'downloader/downloader': './src/downloader/downloader.ts',
|
||||||
|
'2fa/2fa': './src/2fa/2fa.ts',
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.ts', '.js'],
|
||||||
|
alias: {
|
||||||
|
jslib: path.join(__dirname, 'jslib/src'),
|
||||||
|
},
|
||||||
|
symlinks: false,
|
||||||
|
modules: [path.resolve('node_modules')],
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
filename: '[name].js',
|
||||||
|
path: path.resolve(__dirname, 'build'),
|
||||||
|
},
|
||||||
|
module: { rules: moduleRules },
|
||||||
|
plugins: plugins,
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
Loading…
Reference in New Issue
Block a user