From 7fe19cb770d891ca508323fc1c722c750629724d Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Sat, 13 Feb 2016 13:29:45 +0100 Subject: [PATCH] try to fix css webpack problem --- app/app.old.vue | 38 +++++++ app/app.vue | 25 +---- app/components/features.vue | 9 +- app/components/header.vue | 110 +++++++++---------- app/components/headlines.vue | 31 ++++-- app/components/index.old.vue | 29 +++++ app/components/password-generator.vue | 41 ++++--- app/locales.js | 194 ++++++++++++++++++++++++++++++++++ app/locales/locales.js | 181 ------------------------------- app/main.js | 56 ++-------- app/main.old.js | 51 +++++++++ app/router.js | 43 ++++++++ app/services/auth.js | 7 +- app/services/logging.js | 9 +- index.html | 2 +- package.json | 25 ++--- webpack.config.js | 67 ++++-------- webpack.config.old.js | 86 +++++++++++++++ 18 files changed, 602 insertions(+), 402 deletions(-) create mode 100644 app/app.old.vue create mode 100644 app/components/index.old.vue create mode 100644 app/locales.js delete mode 100644 app/locales/locales.js create mode 100644 app/main.old.js create mode 100644 app/router.js create mode 100644 webpack.config.old.js diff --git a/app/app.old.vue b/app/app.old.vue new file mode 100644 index 0000000..a9232a6 --- /dev/null +++ b/app/app.old.vue @@ -0,0 +1,38 @@ + + + + \ No newline at end of file diff --git a/app/app.vue b/app/app.vue index 5b090de..5a7d1b4 100644 --- a/app/app.vue +++ b/app/app.vue @@ -1,19 +1,10 @@ diff --git a/app/components/password-generator.vue b/app/components/password-generator.vue index 100a278..841e947 100644 --- a/app/components/password-generator.vue +++ b/app/components/password-generator.vue @@ -1,6 +1,8 @@ + diff --git a/package.json b/package.json index e254fbc..52e3306 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "predev": "npm install", "dev": "webpack-dev-server --inline --hot --host 0.0.0.0", "prebuild": "rimraf dist && npm prune && npm install", - "build": "NODE_ENV=production webpack --progress --hide-modules", + "build": "NODE_ENV=production webpack -p", "start": "NODE_ENV=production node server.js" }, "repository": { @@ -28,22 +28,22 @@ "homepage": "https://github.com/guillaumevincent/lesspass#readme", "dependencies": { "bootstrap": "^4.0.0-alpha.2", - "clipboard": "^1.5.5", + "clipboard": "^1.5.8", "express": "^4.13.4", "font-awesome": "^4.5.0", "jquery": "^2.2.0", "tether": "^1.1.1", "toastr": "^2.1.2", - "vue": "^1.0.15", - "vue-i18n": "^2.3.3", + "vue": "^1.0.16", + "vue-i18n": "^2.4.0", "vue-resource": "^0.7.0", "vue-router": "^0.7.10" }, "devDependencies": { - "babel-core": "^6.4.5", - "babel-loader": "^6.2.1", - "babel-plugin-transform-runtime": "^6.4.3", - "babel-preset-es2015": "^6.3.13", + "babel-core": "^6.5.1", + "babel-loader": "^6.2.2", + "babel-plugin-transform-runtime": "^6.5.0", + "babel-preset-es2015": "^6.5.0", "babel-runtime": "^5.8.34", "css-loader": "^0.23.1", "eslint": "^1.10.3", @@ -57,16 +57,17 @@ "nodemon": "latest", "npm-run-all": "latest", "rimraf": "^2.5.1", + "style-loader": "^0.13.0", "template-html-loader": "0.0.3", "uglify-js": "^2.6.1", "url-loader": "^0.5.7", - "vue-hot-reload-api": "^1.2.2", + "vue-hot-reload-api": "^1.3.2", "vue-html-loader": "^1.1.0", - "vue-loader": "^8.0.2", + "vue-loader": "^8.1.1", "vue-style-loader": "^1.0.0", - "vueify": "^8.3.2", + "vueify": "^8.3.5", "vueify-insert-css": "^1.0.0", - "webpack": "^1.12.12", + "webpack": "^1.12.13", "webpack-dev-server": "^1.14.1" }, "babel": { diff --git a/webpack.config.js b/webpack.config.js index 8e94385..89467d8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,61 +1,38 @@ var webpack = require('webpack'); module.exports = { - entry: ['./app/main.js'], + context: __dirname + "/app", + entry: "./main.js", output: { - path: './dist', + path: __dirname + "/dist", publicPath: '/dist/', - filename: 'app.js' - }, - devServer: { - port: 8080 + filename: "bundle.js" }, + module: { loaders: [ - { - test: /\.scss$/, - loaders: ['css', 'sass'] - }, + //{test: /\.js$/, loader: 'babel-loader', query: {presets: ['es2015']}}, + { test: /\.js$/, exclude: /node_modules|vue\/dist|vue-router\/|vue-loader\/|vue-hot-reload-api\//, loader: 'babel' }, - { - test: /\.vue$/, - loader: 'vue' - }, - { - test: /\.(png|jpe?g|gif)$/, - loader: 'url', - query: { - limit: 10000, - name: '[name].[ext]?[hash]' - } - } + {test: /\.css$/, loader: 'style-loader!css-loader'}, + {test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'}, + {test: /\.vue$/, loader: 'vue'}, + { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"}, + { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"}, + { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"}, + {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"}, + { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"} ] }, - babel: { - presets: ['es2015'], - plugins: ['transform-runtime'] - } -}; - -if (process.env.NODE_ENV === 'production') { - module.exports.plugins = [ - new webpack.DefinePlugin({ - 'process.env': { - NODE_ENV: '"production"' - } - }), - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false - }, - comments: false - }), - new webpack.optimize.OccurenceOrderPlugin() + plugins: [ + new webpack.ProvidePlugin({ + $: "jquery", + jQuery: "jquery", + "window.jQuery": "jquery" + }) ] -} else { - module.exports.devtool = '#source-map' -} \ No newline at end of file +}; \ No newline at end of file diff --git a/webpack.config.old.js b/webpack.config.old.js new file mode 100644 index 0000000..553bf9e --- /dev/null +++ b/webpack.config.old.js @@ -0,0 +1,86 @@ +var webpack = require('webpack'); + +module.exports = { + entry: ['./app/main.js'], + output: { + path: './dist', + publicPath: '/dist/', + filename: 'app.js' + }, + devServer: { + port: 8080 + }, + module: { + loaders: [ + { + test: /\.scss$/, + loaders: ['css', 'sass'] + }, + { + test: /\.js$/, + exclude: /node_modules|vue\/dist|vue-router\/|vue-loader\/|vue-hot-reload-api\//, + loader: 'babel' + }, + { + test: /\.vue$/, + loader: 'vue' + }, + { + test: /\.(png|jpe?g|gif)$/, + loader: 'url', + query: { + limit: 10000, + name: '[name].[ext]?[hash]' + } + }, + { + test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, + loader: "url?limit=10000&mimetype=application/font-woff" + }, + { + test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, + loader: "url?limit=10000&mimetype=application/font-woff" + }, + { + test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, + loader: "url?limit=10000&mimetype=application/octet-stream" + }, + { + test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, + loader: "file" + }, + { + test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, + loader: "url?limit=10000&mimetype=image/svg+xml" + } + ] + }, + babel: { + presets: ['es2015'], + plugins: ['transform-runtime'] + }, + plugins: [ + new webpack.ProvidePlugin({ + $: "jquery", + jQuery: "jquery", + "window.jQuery": "jquery" + }) + ] +}; + +if (process.env.NODE_ENV === 'production') { + module.exports.plugins = [ + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: '"production"' + } + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + }, + comments: false + }), + new webpack.optimize.OccurenceOrderPlugin() + ] +} \ No newline at end of file