From 01f83066ac7668f73be506afc869c717bfff7393 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 7 Aug 2018 09:21:34 +0200 Subject: [PATCH] Fix js build Signed-off-by: Christoph Wurst --- js/webpack.base.config.js | 21 ++++++++++++++++++++- package.json | 5 +++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/js/webpack.base.config.js b/js/webpack.base.config.js index 13bd91fc..7e9cd806 100644 --- a/js/webpack.base.config.js +++ b/js/webpack.base.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const {VueLoaderPlugin} = require('vue-loader') module.exports = { entry: './js/init.js', @@ -20,7 +21,25 @@ module.exports = { options: { loaders: {} } + }, + { + test: /\.css$/, + use: [ + { + loader: 'vue-style-loader' + }, + { + loader: 'css-loader', + options: { + modules: true, + localIdentName: '[local]_[hash:base64:8]' + } + } + ] } ] - } + }, + plugins: [ + new VueLoaderPlugin() + ] }; diff --git a/package.json b/package.json index c4856eaa..d4fd9881 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "test": "tests" }, "scripts": { - "build": "./node_modules/webpack-cli/bin/webpack.js --config js/webpack.prod.config.js", - "dev": "./node_modules/webpack-cli/bin/webpack.js --config js/webpack.dev.config.js --watch", + "build": "./node_modules/webpack-cli/bin/cli.js --config js/webpack.prod.config.js", + "dev": "./node_modules/webpack-cli/bin/cli.js --config js/webpack.dev.config.js --watch", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { @@ -24,6 +24,7 @@ "nextcloud_fetch": "^2.1.0", "vue": "^2.5.17", "vue-loader": "^15.2.7", + "vue-style-loader": "^4.1.1", "vue-template-compiler": "^2.5.17" }, "devDependencies": {