summaryrefslogtreecommitdiffstats
path: root/webpack.common.js
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-09-26 17:51:44 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-09-26 18:46:38 +0200
commitdd0a064868d8d96249df5445fff2ceaf80ea62e5 (patch)
tree76f055c5c9a869b26d78a14f8f4192b467898a49 /webpack.common.js
parent713545f51649398676c0fe54c6d4f7c842fe0899 (diff)
Move to global eslint
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'webpack.common.js')
-rw-r--r--webpack.common.js42
1 files changed, 12 insertions, 30 deletions
diff --git a/webpack.common.js b/webpack.common.js
index af5d6759..63df5680 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -2,14 +2,17 @@ const path = require('path')
const webpack = require('webpack')
const { VueLoaderPlugin } = require('vue-loader')
const StyleLintPlugin = require('stylelint-webpack-plugin')
+const packageJson = require('./package.json')
+const appName = packageJson.name
+const appVersion = JSON.stringify(packageJson.version)
module.exports = {
entry: path.join(__dirname, 'src', 'main.js'),
output: {
path: path.resolve(__dirname, './js'),
publicPath: '/js/',
- filename: 'contacts.js',
- chunkFilename: 'chunks/contacts.[name].[contenthash].js'
+ filename: `${appName}.js`,
+ chunkFilename: 'chunks/[name]-[hash].js'
},
module: {
rules: [
@@ -24,29 +27,18 @@ module.exports = {
{
test: /\.(js|vue)$/,
use: 'eslint-loader',
+ exclude: /node_modules/,
enforce: 'pre'
},
{
test: /\.vue$/,
- loader: 'vue-loader'
+ loader: 'vue-loader',
+ exclude: /node_modules/
},
{
test: /\.js$/,
- use: {
- loader: 'babel-loader',
- options: {
- plugins: [
- '@babel/plugin-syntax-dynamic-import',
- '@babel/plugin-proposal-object-rest-spread'
- ],
- presets: ['@babel/preset-env']
- }
- },
- exclude: /node_modules\/(?!(p-limit|p-defer|p-queue|p-try|cdav-library))/
- },
- {
- test: /\.(png|jpg|gif|svg)$/,
- loader: 'url-loader'
+ loader: 'babel-loader',
+ exclude: /node_modules/
}
]
},
@@ -54,19 +46,9 @@ module.exports = {
new VueLoaderPlugin(),
new StyleLintPlugin(),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
- new webpack.DefinePlugin({
- appVersion: JSON.stringify(require('./package.json').version)
- })
+ new webpack.DefinePlugin({ appVersion })
],
resolve: {
- alias: {
- Components: path.resolve(__dirname, 'src/components/'),
- Mixins: path.resolve(__dirname, 'src/mixins/'),
- Models: path.resolve(__dirname, 'src/models/'),
- Services: path.resolve(__dirname, 'src/services/'),
- Store: path.resolve(__dirname, 'src/store/'),
- Views: path.resolve(__dirname, 'src/views/')
- },
- extensions: ['*', '.js', '.vue', '.json']
+ extensions: ['*', '.js', '.vue']
}
}