scripts, connectors, and webpack adjustments
This commit is contained in:
parent
8f14ced5af
commit
29d0803a5c
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
||||||
|
<title>Bitwarden Duo Connector</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body></body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -1,4 +1,7 @@
|
||||||
!(function () {
|
require('../scripts/duo');
|
||||||
|
require('./duo.scss');
|
||||||
|
|
||||||
|
!(function () {
|
||||||
var frameElement = document.createElement('iframe');
|
var frameElement = document.createElement('iframe');
|
||||||
frameElement.setAttribute('id', 'duo_iframe');
|
frameElement.setAttribute('id', 'duo_iframe');
|
||||||
setFrameHeight();
|
setFrameHeight();
|
|
@ -0,0 +1,17 @@
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: #efeff4 url('../images/loading.svg') 0 0 no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 400px;
|
||||||
|
border: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Bitwarden U2F Connector</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body></body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -1,4 +1,6 @@
|
||||||
document.addEventListener('DOMContentLoaded', function (event) {
|
require('../scripts/u2f');
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function (event) {
|
||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
|
|
||||||
<title>Duo Two-step Login</title>
|
|
||||||
<style>
|
|
||||||
html, body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background: #efeff4 url('images/loading.svg') 0 0 no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
iframe {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 400px;
|
|
||||||
border: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script src="js/duo.js"></script>
|
|
||||||
<script src="js/duo-connector.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title>U2F Connector</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script src="js/u2f-api.js"></script>
|
|
||||||
<script src="js/u2f-connector.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -35,6 +35,18 @@ const moduleRules = [
|
||||||
test: /\.(html)$/,
|
test: /\.(html)$/,
|
||||||
loader: 'html-loader',
|
loader: 'html-loader',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
test: /\.(jpe?g|png|gif|svg)$/i,
|
||||||
|
exclude: /.*(fontawesome-webfont|glyphicons-halflings-regular)\.svg/,
|
||||||
|
use: [{
|
||||||
|
loader: 'file-loader',
|
||||||
|
options: {
|
||||||
|
name: '[name].[ext]',
|
||||||
|
outputPath: 'images/',
|
||||||
|
publicPath: './images/',
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.scss$/,
|
test: /\.scss$/,
|
||||||
use: extractCss.extract({
|
use: extractCss.extract({
|
||||||
|
@ -61,7 +73,17 @@ const plugins = [
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: './src/index.html',
|
template: './src/index.html',
|
||||||
filename: 'index.html',
|
filename: 'index.html',
|
||||||
chunks: ['vendor', 'main'],
|
chunks: ['app/vendor', 'app/main'],
|
||||||
|
}),
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
template: './src/connectors/duo.html',
|
||||||
|
filename: 'duo-connector.html',
|
||||||
|
chunks: ['connectors/duo'],
|
||||||
|
}),
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
template: './src/connectors/u2f.html',
|
||||||
|
filename: 'u2f-connector.html',
|
||||||
|
chunks: ['connectors/u2f'],
|
||||||
}),
|
}),
|
||||||
new CopyWebpackPlugin([
|
new CopyWebpackPlugin([
|
||||||
{ from: './src/manifest.json' },
|
{ from: './src/manifest.json' },
|
||||||
|
@ -73,7 +95,7 @@ const plugins = [
|
||||||
]),
|
]),
|
||||||
new webpack.SourceMapDevToolPlugin({
|
new webpack.SourceMapDevToolPlugin({
|
||||||
filename: '[name].js.map',
|
filename: '[name].js.map',
|
||||||
include: ['main.js'],
|
include: ['app/main.js'],
|
||||||
}),
|
}),
|
||||||
extractCss,
|
extractCss,
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
|
@ -113,7 +135,9 @@ const config = {
|
||||||
mode: ENV,
|
mode: ENV,
|
||||||
serve: serve,
|
serve: serve,
|
||||||
entry: {
|
entry: {
|
||||||
'main': './src/app/main.ts',
|
'app/main': './src/app/main.ts',
|
||||||
|
'connectors/u2f': './src/connectors/u2f.js',
|
||||||
|
'connectors/duo': './src/connectors/duo.js',
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.ts', '.js'],
|
extensions: ['.ts', '.js'],
|
||||||
|
@ -132,7 +156,7 @@ const config = {
|
||||||
cacheGroups: {
|
cacheGroups: {
|
||||||
vendor: {
|
vendor: {
|
||||||
test: isVendorModule,
|
test: isVendorModule,
|
||||||
name: 'vendor',
|
name: 'app/vendor',
|
||||||
chunks: 'initial',
|
chunks: 'initial',
|
||||||
enforce: true,
|
enforce: true,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue