Use shared webpack config
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
6
package-lock.json
generated
6
package-lock.json
generated
@@ -5601,6 +5601,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@nextcloud/webpack-vue-config": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@nextcloud/webpack-vue-config/-/webpack-vue-config-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-3eDbH05tlkfM12syuM36QS+xU1r80iX21PZ5tN+/O9Ekto2psmt+vf7Vgs5JX20M97Uy89POQ09A8tQUj83Yuw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@nodelib/fs.scandir": {
|
"@nodelib/fs.scandir": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -17,13 +17,13 @@
|
|||||||
"license": "agpl",
|
"license": "agpl",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NODE_ENV=development webpack --config webpack.dev.js",
|
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.js",
|
||||||
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.dev.js",
|
"dev": "NODE_ENV=development webpack --progress --config webpack.js",
|
||||||
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.prod.js",
|
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.js",
|
||||||
"lint": "eslint --ext .js,.vue src",
|
"lint": "eslint --ext .js,.vue src",
|
||||||
"lint:fix": "eslint --ext .js,.vue src --fix",
|
"lint:fix": "eslint --ext .js,.vue src --fix",
|
||||||
"stylelint": "stylelint **/*.css **/*.scss **/*.vue",
|
"stylelint": "stylelint src",
|
||||||
"stylelint:fix": "stylelint **/*.css **/*.scss **/*.vue --fix",
|
"stylelint:fix": "stylelint src --fix",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:coverage": "jest --coverage"
|
"test:coverage": "jest --coverage"
|
||||||
},
|
},
|
||||||
@@ -72,6 +72,7 @@
|
|||||||
"@nextcloud/browserslist-config": "^1.0.0",
|
"@nextcloud/browserslist-config": "^1.0.0",
|
||||||
"@nextcloud/eslint-config": "^2.0.0",
|
"@nextcloud/eslint-config": "^2.0.0",
|
||||||
"@nextcloud/eslint-plugin": "^1.4.0",
|
"@nextcloud/eslint-plugin": "^1.4.0",
|
||||||
|
"@nextcloud/webpack-vue-config": "^1.1.0",
|
||||||
"@vue/test-utils": "^1.0.3",
|
"@vue/test-utils": "^1.0.3",
|
||||||
"acorn": "^7.3.1",
|
"acorn": "^7.3.1",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const { VueLoaderPlugin } = require('vue-loader');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: {
|
|
||||||
deck: path.join(__dirname, 'src', 'main.js'),
|
|
||||||
collections: path.join(__dirname, 'src', 'init-collections.js'),
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
filename: '[name].js',
|
|
||||||
path: __dirname + '/js',
|
|
||||||
publicPath: '/js/',
|
|
||||||
jsonpFunction: 'webpackJsonpOCADeck',
|
|
||||||
chunkFilename: '[name].js?v=[contenthash]',
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.css$/,
|
|
||||||
use: ['vue-style-loader', 'css-loader']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.scss$/,
|
|
||||||
use: [
|
|
||||||
'vue-style-loader',
|
|
||||||
'css-loader',
|
|
||||||
'sass-loader'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.vue$/,
|
|
||||||
loader: 'vue-loader'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.js$/,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
exclude: /node_modules/
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.(png|jpg|gif|svg)$/,
|
|
||||||
loader: 'url-loader',
|
|
||||||
options: {
|
|
||||||
name: '[name].[ext]?[hash]'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
plugins: [new VueLoaderPlugin()],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
vue$: 'vue/dist/vue.esm.js'
|
|
||||||
},
|
|
||||||
extensions: ['*', '.js', '.vue', '.json'],
|
|
||||||
modules: [
|
|
||||||
path.resolve(__dirname, 'node_modules'),
|
|
||||||
'node_modules'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
const merge = require('webpack-merge');
|
|
||||||
const common = require('./webpack.common.js');
|
|
||||||
|
|
||||||
module.exports = merge(common, {
|
|
||||||
mode: 'development',
|
|
||||||
devServer: {
|
|
||||||
historyApiFallback: true,
|
|
||||||
overlay: true
|
|
||||||
},
|
|
||||||
devtool: 'source-map',
|
|
||||||
})
|
|
||||||
25
webpack.js
Normal file
25
webpack.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
const webpackConfig = require('@nextcloud/webpack-vue-config')
|
||||||
|
const path = require('path');
|
||||||
|
const { merge } = require('webpack-merge')
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
entry: {
|
||||||
|
deck: path.join(__dirname, 'src', 'main.js'),
|
||||||
|
collections: path.join(__dirname, 'src', 'init-collections.js'),
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
filename: '[name].js',
|
||||||
|
jsonpFunction: 'webpackJsonpOCADeck',
|
||||||
|
chunkFilename: '[name].js?v=[contenthash]',
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['*', '.js', '.vue', '.json'],
|
||||||
|
modules: [
|
||||||
|
path.resolve(__dirname, 'node_modules'),
|
||||||
|
'node_modules'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = merge(config, webpackConfig)
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
const merge = require('webpack-merge')
|
|
||||||
const common = require('./webpack.common.js')
|
|
||||||
|
|
||||||
module.exports = merge(common, {
|
|
||||||
mode: 'production',
|
|
||||||
devtool: '#source-map'
|
|
||||||
})
|
|
||||||
Reference in New Issue
Block a user