Browse Source

reduce bundle size

pull/342/head
Guillaume Vincent 8 years ago
parent
commit
5635b36ac8
8 changed files with 94 additions and 25733 deletions
  1. +0
    -25692
      dist/lesspass.js
  2. +5
    -8
      dist/lesspass.min.css
  3. +10
    -10
      dist/lesspass.min.js
  4. +6
    -1
      index.html
  5. +9
    -5
      package.json
  6. +52
    -0
      src/LessPass.scss
  7. +1
    -3
      src/main.js
  8. +11
    -14
      webpack.config.js

+ 0
- 25692
dist/lesspass.js
File diff suppressed because it is too large
View File


+ 5
- 8
dist/lesspass.min.css
File diff suppressed because it is too large
View File


+ 10
- 10
dist/lesspass.min.js
File diff suppressed because it is too large
View File


+ 6
- 1
index.html View File

@@ -14,11 +14,16 @@
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }

@media (min-width: 544px) {
#lesspass {
margin-top: 1em;
}
}
</style> </style>
</head> </head>
<body> <body>
<div class="center"> <div class="center">
<div class="py-1 hidden-sm-down"></div>
<div id="lesspass" class="m-x-auto"></div> <div id="lesspass" class="m-x-auto"></div>
</div> </div>
<script src="dist/lesspass.min.js"></script> <script src="dist/lesspass.min.js"></script>


+ 9
- 5
package.json View File

@@ -26,6 +26,7 @@
"babel-loader": "^6.2.7", "babel-loader": "^6.2.7",
"bootstrap": "4.0.0-alpha.5", "bootstrap": "4.0.0-alpha.5",
"clipboard": "^1.5.15", "clipboard": "^1.5.15",
"css-loader": "^0.26.1",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"hint.css": "^2.4.1", "hint.css": "^2.4.1",
"jwt-decode": "^2.1.0", "jwt-decode": "^2.1.0",
@@ -33,9 +34,10 @@
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"nock": "^9.0.2", "nock": "^9.0.2",
"primer-css": "^4.3.0", "primer-css": "^4.3.0",
"vue": "^2.0.7",
"vue": "^2.1.4",
"vue-loader": "^10.0.1", "vue-loader": "^10.0.1",
"vue-router": "^2.0.2",
"vue-router": "^2.1.1",
"vue-template-compiler": "^2.1.4",
"vuex": "^2.0.0" "vuex": "^2.0.0"
}, },
"devDependencies": { "devDependencies": {
@@ -53,14 +55,16 @@
"file-loader": "^0.9.0", "file-loader": "^0.9.0",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"nock": "^9.0.0", "nock": "^9.0.0",
"node-sass": "^3.13.0",
"optimize-css-assets-webpack-plugin": "^1.3.0", "optimize-css-assets-webpack-plugin": "^1.3.0",
"purifycss-webpack-plugin": "^2.0.3",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1", "style-loader": "^0.13.1",
"unminified-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.7", "url-loader": "^0.5.7",
"vue-loader": "^10.0.1", "vue-loader": "^10.0.1",
"vue-template-compiler": "^2.1.3", "vue-template-compiler": "^2.1.3",
"webpack": "2.1.0-beta.25",
"webpack-dev-server": "2.1.0-beta.9"
"webpack": "^2.1.0-beta.27",
"webpack-dev-server": "^2.1.0-beta.12"
}, },
"ava": { "ava": {
"require": [ "require": [


+ 52
- 0
src/LessPass.scss View File

@@ -0,0 +1,52 @@
//$enable-flex: true;

// Core variables and mixins
@import "~bootstrap/scss/custom";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";

// Reset and dependencies
@import "~bootstrap/scss/normalize";
//@import "~bootstrap/scss/print";

// Core CSS
@import "~bootstrap/scss/reboot";
@import "~bootstrap/scss/type";
//@import "~bootstrap/scss/images";
//@import "~bootstrap/scss/code";
@import "~bootstrap/scss/grid";
//@import "~bootstrap/scss/tables";
@import "~bootstrap/scss/forms";
@import "~bootstrap/scss/buttons";

// Components
//@import "~bootstrap/scss/animation";
//@import "~bootstrap/scss/dropdown";
@import "~bootstrap/scss/button-group";
@import "~bootstrap/scss/input-group";
@import "~bootstrap/scss/custom-forms";
//@import "~bootstrap/scss/nav";
//@import "~bootstrap/scss/navbar";
@import "~bootstrap/scss/card";
//@import "~bootstrap/scss/breadcrumb";
//@import "~bootstrap/scss/pagination";
//@import "~bootstrap/scss/tags";
//@import "~bootstrap/scss/jumbotron";
@import "~bootstrap/scss/alert";
//@import "~bootstrap/scss/progress";
//@import "~bootstrap/scss/media";
@import "~bootstrap/scss/list-group";
//@import "~bootstrap/scss/responsive-embed";
//@import "~bootstrap/scss/close";

// Components w/ JavaScript
//@import "~bootstrap/scss/modal";
//@import "~bootstrap/scss/tooltip";
//@import "~bootstrap/scss/popover";
//@import "~bootstrap/scss/carousel";

// Utility classes
@import "~bootstrap/scss/utilities";

@import '~font-awesome/css/font-awesome.css';
@import '~hint.css/hint.css';

+ 1
- 3
src/main.js View File

@@ -1,7 +1,5 @@
import Vue from 'vue'; import Vue from 'vue';
import 'bootstrap/dist/css/bootstrap.css';
import 'font-awesome/css/font-awesome.css';
import 'hint.css/hint.css';
import './LessPass.scss';
import LessPass from './LessPass.vue'; import LessPass from './LessPass.vue';
import store from './store'; import store from './store';
import router from './router'; import router from './router';


+ 11
- 14
webpack.config.js View File

@@ -1,7 +1,7 @@
var webpack = require('webpack'); var webpack = require('webpack');
var path = require('path'); var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin');
var UnminifiedWebpackPlugin = require('unminified-webpack-plugin');
var purify = require("purifycss-webpack-plugin");
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');


module.exports = { module.exports = {
@@ -22,14 +22,7 @@ module.exports = {
{test: /\.js$/, include: [path.resolve(__dirname, './src')], loader: 'babel-loader'}, {test: /\.js$/, include: [path.resolve(__dirname, './src')], loader: 'babel-loader'},
{test: /\.json/, loader: 'json-loader'}, {test: /\.json/, loader: 'json-loader'},
{test: /\.(png|jpg|jpeg|gif)$/, loader: 'file-loader?name=[name].[ext]'}, {test: /\.(png|jpg|jpeg|gif)$/, loader: 'file-loader?name=[name].[ext]'},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader',
publicPath: ''
})
},
{test: /\.scss$/, loader: ExtractTextPlugin.extract({fallbackLoader: 'style-loader', loader: 'css-loader!sass-loader', publicPath: ''})},
{test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'}, {test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'},
{test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'}, {test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'},
{test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/octet-stream'}, {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/octet-stream'},
@@ -38,7 +31,14 @@ module.exports = {
] ]
}, },
plugins: [ plugins: [
new ExtractTextPlugin('lesspass.min.css')
new ExtractTextPlugin('lesspass.min.css'),
new purify({
basePath: __dirname,
paths: [
"src/**/*.html",
"src/**/*.vue"
]
})
], ],
devtool: '#eval-source-map' devtool: '#eval-source-map'
}; };
@@ -47,14 +47,11 @@ if (process.env.NODE_ENV === 'production') {
module.exports.devtool = false; module.exports.devtool = false;
module.exports.plugins = (module.exports.plugins || []).concat([ module.exports.plugins = (module.exports.plugins || []).concat([
new OptimizeCssAssetsPlugin(), new OptimizeCssAssetsPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
compress: { compress: {
warnings: false warnings: false
} }
}),
new UnminifiedWebpackPlugin()
})
]); ]);
} }



Loading…
Cancel
Save