Просмотр исходного кода

simplify webpack configuration

pull/342/head
Guillaume Vincent 8 лет назад
Родитель
Сommit
cc1a341798
12 измененных файлов: 109 добавлений и 123 удалений
  1. +0
    -5
      .babelrc
  2. +0
    -9
      .editorconfig
  3. +0
    -13
      .eslintrc.js
  4. +0
    -7
      .gitignore
  5. +10
    -16
      README.md
  6. +6
    -6
      index.html
  7. +29
    -65
      package.json
  8. +1
    -1
      src/app/Navbar/Navbar.vue
  9. +1
    -1
      src/landing-page/PasswordGenerator/PasswordGenerator.vue
  10. +4
    -0
      src/services/auth.js
  11. +0
    -0
      static/.gitkeep
  12. +58
    -0
      webpack.config.js

+ 0
- 5
.babelrc Просмотреть файл

@@ -1,5 +0,0 @@
{
"presets": ["es2015", "stage-2"],
"plugins": ["transform-runtime"],
"comments": false
}

+ 0
- 9
.editorconfig Просмотреть файл

@@ -1,9 +0,0 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

+ 0
- 13
.eslintrc.js Просмотреть файл

@@ -1,13 +0,0 @@
module.exports = {
root: true,
extends: "airbnb/base",
// required to lint *.vue files
plugins: [
'html'
],
// add your custom rules here
'rules': {
'max-len': 0,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
}
}

+ 0
- 7
.gitignore Просмотреть файл

@@ -1,7 +0,0 @@
.DS_Store
node_modules/
dist/
npm-debug.log
selenium-debug.log
test/unit/coverage
test/e2e/reports

+ 10
- 16
README.md Просмотреть файл

@@ -1,27 +1,21 @@
# lesspass

> open source password manager
open source password manager

## Build Setup

``` bash
# install dependencies
npm install
install dependencies

# serve with hot reload at localhost:8080
npm run dev
npm install

# build for production with minification
npm run build
serve with hot reload at localhost:8080

# run unit tests
npm run unit
npm run dev

# run e2e tests
npm run e2e
build for production with minification

# run all tests
npm test
```
npm run build

For detailed explanation on how things work, checkout the [guide](https://github.com/vuejs-templates/webpack#vue-webpack-boilerplate) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
run tests

npm test

+ 6
- 6
index.html Просмотреть файл

@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="utf-8">
<title>lesspass</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</head>
<body>
<div id="app"></div>
<script src="/dist/build.js"></script>
</body>
</html>

+ 29
- 65
package.json Просмотреть файл

@@ -1,86 +1,50 @@
{
"name": "lesspass",
"version": "1.0.0",
"name": "frontend",
"description": "open source password manager",
"author": "Guillaume Vincent <guillaume@oslab.fr>",
"scripts": {
"dev": "node build/dev-server.js",
"build": "rimraf dist && mkdirp dist && ncp static dist/static && cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.prod.conf.js",
"unit": "karma start test/unit/karma.conf.js --single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e"
"dev": "webpack-dev-server --inline --hot --host 0.0.0.0",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"bootstrap": "^4.0.0-alpha.2",
"clipboard": "^1.5.8",
"clipboard": "^1.5.9",
"es6-promise": "^3.1.2",
"express": "^4.13.4",
"font-awesome": "^4.5.0",
"jquery": "^2.2.1",
"isomorphic-fetch": "^2.2.1",
"jquery": "^2.2.2",
"lesspass": "^1.1.1",
"tether": "^1.2.0",
"toastr": "^2.1.2",
"vue": "^1.0.17",
"vue-i18n": "^2.4.0",
"vue-resource": "^0.7.0",
"vue-router": "^0.7.11",
"whatwg-fetch": "^0.11.0"
"vue": "^1.0.20",
"vue-i18n": "^2.4.1",
"vue-router": "^0.7.11"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.0.0",
"babel-runtime": "^5.8.0",
"chromedriver": "^2.21.2",
"connect-history-api-fallback": "^1.1.0",
"babel-core": "^6.7.4",
"babel-loader": "^6.2.4",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "^6.6.0",
"cross-env": "^1.0.7",
"cross-spawn": "^2.1.5",
"css-loader": "^0.23.0",
"eslint": "^2.4.0",
"eslint-config-airbnb": "^6.1.0",
"eslint-config-standard": "^5.1.0",
"eslint-friendly-formatter": "^1.2.2",
"eslint-loader": "^1.3.0",
"eslint-plugin-html": "^1.3.0",
"eslint-plugin-promise": "^1.0.8",
"eslint-plugin-react": "^4.2.2",
"eslint-plugin-standard": "^1.3.2",
"eventsource-polyfill": "^0.9.6",
"exports-loader": "^0.6.3",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.4",
"function-bind": "^1.0.2",
"html-webpack-plugin": "^2.8.1",
"http-proxy-middleware": "^0.11.0",
"imports-loader": "^0.6.5",
"inject-loader": "^2.0.1",
"isparta-loader": "^2.0.0",
"jasmine-core": "^2.4.1",
"css-loader": "^0.23.1",
"file-loader": "^0.8.5",
"json-loader": "^0.5.4",
"karma": "^0.13.15",
"karma-coverage": "^0.5.5",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.24",
"karma-webpack": "^1.7.0",
"mkdirp": "^0.5.1",
"ncp": "^2.0.0",
"nightwatch": "^0.8.18",
"phantomjs-prebuilt": "^2.1.3",
"rimraf": "^2.5.0",
"selenium-server": "2.52.0",
"url-loader": "^0.5.7",
"vue-hot-reload-api": "^1.2.0",
"vue-html-loader": "^1.0.0",
"vue-loader": "^8.1.3",
"vue-hot-reload-api": "^1.3.2",
"vue-html-loader": "^1.2.0",
"vue-loader": "^8.2.2",
"vue-style-loader": "^1.0.0",
"webpack": "^1.12.2",
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0",
"webpack-merge": "^0.8.3"
"webpack": "^1.12.14",
"webpack-dev-server": "^1.14.1"
},
"babel": {
"presets": [
"es2015"
],
"plugins": [
"transform-runtime"
],
"comments": false
}
}

+ 1
- 1
src/app/Navbar/Navbar.vue Просмотреть файл

@@ -6,7 +6,7 @@
}

#navbar #navbar__logo {
height: 32px;
height: 36px;
}

#navbar .navbar {


+ 1
- 1
src/landing-page/PasswordGenerator/PasswordGenerator.vue Просмотреть файл

@@ -72,7 +72,7 @@
</div>
</div>
</div>
<div class="form-group row">
<div class="form-group row m-b-0">
<div class="col-lg-12">
<i class="fa fa-cog"></i>
<a data-toggle="collapse" data-parent="#accordion" href="#advancedOptions"


+ 4
- 0
src/services/auth.js Просмотреть файл

@@ -1,3 +1,7 @@
import promise from 'es6-promise';
promise.polyfill();
import 'isomorphic-fetch';

function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;


+ 0
- 0
static/.gitkeep Просмотреть файл


+ 58
- 0
webpack.config.js Просмотреть файл

@@ -0,0 +1,58 @@
var path = require('path');
var webpack = require('webpack');

module.exports = {
entry: './src/main.js',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'build.js'
},
resolve: {
extensions: ['', '.js', '.vue'],
fallback: [path.join(__dirname, 'node_modules')],
alias: {
'src': path.resolve(__dirname, './src')
}
},
resolveLoader: {root: path.join(__dirname, 'node_modules'),},
module: {
loaders: [
{
test: /\.vue$/, loader: 'vue'
},
{
test: /\.js$/, loader: 'babel', exclude: /node_modules/
},
{
test: /\.json$/, loader: 'json'
},
{
test: /\.html$/, loader: 'vue-html'
},
{
test: /\.(png|jpg|gif|svg|woff2?|eot|ttf)(\?.*)?$/,
loader: 'url',
query: {limit: 10000, name: '[name].[ext]?[hash:7]'}
}
]
},
devServer: {historyApiFallback: true, noInfo: true},
devtool: 'eval-source-map',
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
'window.jQuery': "jquery",
})
]
};

if (process.env.NODE_ENV === 'production') {
module.exports.devtool = 'source-map';
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({'process.env': {NODE_ENV: '"production"'}}),
new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}}),
new webpack.optimize.OccurenceOrderPlugin()
])
}

Загрузка…
Отмена
Сохранить