Skip to content

Commit

Permalink
Merge pull request #26 from LoanR/vue-restart
Browse files Browse the repository at this point in the history
Vue restart
  • Loading branch information
LoanR authored Mar 20, 2019
2 parents c7a4071 + a9d47b0 commit 9e83de9
Show file tree
Hide file tree
Showing 155 changed files with 13,454 additions and 1,172 deletions.
Binary file removed .DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/env",
{
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}
]
]
}
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
parserOptions: {
parser: 'babel-eslint'
},
extends: [
'plugin:vue/recommended',
'standard'
],
plugins: [
'vue'
]
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
node_modules/
bin/
.vscode/
46 changes: 46 additions & 0 deletions build/webpack.conf.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use strict'

const HtmlWebpackPlugin = require('html-webpack-plugin')
const { VueLoaderPlugin } = require('vue-loader')

module.exports = {
module: {
rules: [
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.js$/,
use: 'babel-loader'
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
use: {
loader: 'url-loader'
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
use: {
loader: 'url-loader'
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
use: {
loader: 'url-loader'
}
}
]
},

plugins: [
new VueLoaderPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
})
]
}
53 changes: 53 additions & 0 deletions build/webpack.conf.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict'

const baseConfig = require('./webpack.conf.base')

const webpack = require('webpack')
const merge = require('webpack-merge')

module.exports = merge(baseConfig, {
// mode: 'development',

devServer: {
// historyApiFallback: true,
hot: true,
watchOptions: {
poll: true
},
stats: {
all: false,
version: true,
timings: true,
builtAt: true,
modules: true,
maxModules: 0,
errors: true,
warnings: true,
moduleTrace: false,
errorDetails: true
}
},

module: {
rules: [
{
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
'postcss-loader',
'sass-loader'
]
},
{
test: /\.(js|vue)$/,
use: 'eslint-loader',
enforce: 'pre'
}
]
},

plugins: [
new webpack.HotModuleReplacementPlugin()
]
})
67 changes: 67 additions & 0 deletions build/webpack.conf.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
'use strict'

const baseConfig = require('./webpack.conf.base')

const merge = require('webpack-merge')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')

const path = require('path')

function resolve (dir) {
return path.join(__dirname, '..', dir)
}

module.exports = merge(baseConfig, {
// mode: 'production',

optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true
}),
new OptimizeCSSAssetsPlugin({})
],
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'all'
}
}
}
},
output: {
path: path.resolve(__dirname, '../dist')
},

module: {
rules: [
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'postcss-loader',
'sass-loader'
]
}
]
},

plugins: [
new CopyWebpackPlugin([{
from: resolve('static'),
to: resolve('dist/static'),
toType: 'dir'
}]),
new MiniCssExtractPlugin({
filename: 'assets/main.css'
})
]
})
Loading

0 comments on commit 9e83de9

Please sign in to comment.