Skip to content

Commit 63510c5

Browse files
committed
Minor cleanup of webpack
1 parent 4335f2b commit 63510c5

16 files changed

+11147
-11333
lines changed

.circleci/config.yml

-36
This file was deleted.

.eslintrc.js

+29-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,34 @@
11
module.exports = {
22
root: true,
3-
extends: 'standard',
4-
plugins: [
5-
'html'
3+
4+
env: {
5+
node: true
6+
},
7+
8+
extends: [
9+
'plugin:vue/essential',
10+
'eslint:recommended',
11+
'@vue/prettier',
612
],
7-
'rules': {
8-
'no-multi-spaces': [
9-
'error', {
10-
exceptions: {
11-
'ImportDeclaration': true
12-
}
13+
14+
parserOptions: {
15+
ecmaVersion: 2020
16+
},
17+
18+
rules: {
19+
'no-console': 'off',
20+
'no-debugger': 'off'
21+
},
22+
23+
overrides: [
24+
{
25+
files: [
26+
'**/*.spec.{j,t}s?(x)',
27+
// '**/tests/unit/**/*.spec.{j,t}s?(x)'
28+
],
29+
env: {
30+
jest: true
1331
}
14-
],
15-
'arrow-parens': 0,
16-
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
17-
}
32+
}
33+
],
1834
}

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"semi": false,
4+
"trailingComma": "none"
5+
}

babel.config.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
module.exports = function(babel) {
2-
babel.cache(true);
2+
babel.cache(true)
33

44
return {
5-
presets: ["@babel/preset-env"],
6-
comments: false,
7-
plugins: ["@babel/plugin-proposal-object-rest-spread"]
8-
};
9-
};
5+
presets: ['@babel/preset-env'],
6+
plugins: ['@babel/plugin-proposal-object-rest-spread']
7+
}
8+
}

build/webpack.base.config.js

+18-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path')
22
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
3-
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin")
3+
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
44
const { VueLoaderPlugin } = require('vue-loader')
55

66
module.exports = {
@@ -10,15 +10,20 @@ module.exports = {
1010
library: 'vue-js-modal',
1111
libraryTarget: 'umd',
1212
path: path.resolve(__dirname, '../dist'),
13-
publicPath: '/dist/',
13+
publicPath: '/dist/'
14+
},
15+
resolve: {
16+
extensions: ['.ts', '.js']
1417
},
1518
optimization: {
1619
minimizer: [
1720
new UglifyJsPlugin({
1821
cache: true,
1922
parallel: true
2023
}),
21-
new OptimizeCSSAssetsPlugin({})
24+
new OptimizeCSSAssetsPlugin({
25+
canPrint: true
26+
})
2227
]
2328
},
2429
module: {
@@ -32,16 +37,19 @@ module.exports = {
3237
loader: 'babel-loader',
3338
exclude: /node_modules/
3439
},
40+
{
41+
test: /\.ts$/,
42+
loader: 'ts-loader',
43+
exclude: /node_modules/,
44+
options: {
45+
appendTsSuffixTo: [/\.vue$/]
46+
}
47+
},
3548
{
3649
test: /\.css$/,
37-
use: [
38-
'vue-style-loader',
39-
'css-loader'
40-
]
50+
use: ['vue-style-loader', 'css-loader']
4151
}
4252
]
4353
},
44-
plugins: [
45-
new VueLoaderPlugin()
46-
]
54+
plugins: [new VueLoaderPlugin()]
4755
}

build/webpack.ssr-no-css.config.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path')
22
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
3-
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
3+
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
44
const VueLoaderPlugin = require('vue-loader/lib/plugin')
55

66
module.exports = {
@@ -26,7 +26,7 @@ module.exports = {
2626
rules: [
2727
{
2828
test: /\.vue$/,
29-
loader: 'vue-loader',
29+
loader: 'vue-loader'
3030
},
3131
{
3232
test: /\.js$/,
@@ -35,17 +35,14 @@ module.exports = {
3535
},
3636
{
3737
test: /\.css$/,
38-
use: [
39-
MiniCssExtractPlugin.loader,
40-
'css-loader'
41-
]
38+
use: [MiniCssExtractPlugin.loader, 'css-loader']
4239
}
4340
]
4441
},
4542
plugins: [
4643
new VueLoaderPlugin(),
4744
new MiniCssExtractPlugin({
48-
filename: "styles.css",
45+
filename: 'styles.css'
4946
})
5047
]
5148
}

circle.yml

-36
This file was deleted.

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ssr.index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ssr.nocss.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)