Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Commit

Permalink
update package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
gsdstr committed Aug 31, 2018
1 parent 45b02dc commit d3f95a5
Show file tree
Hide file tree
Showing 18 changed files with 78,723 additions and 2,633 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Expand Up @@ -29,6 +29,7 @@ tests/e2e/reports
# https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules
npm-debug.log
package-lock.json

# SASS temp files
.sass-cache
Expand Down Expand Up @@ -62,4 +63,8 @@ config.json
data

# Typings definitions
typings
typings

# IDEA
.idea
*.iml
8 changes: 5 additions & 3 deletions build/webpack.base.config.js
Expand Up @@ -2,6 +2,7 @@

let path = require("path");
let webpack = require("webpack");
const VueLoaderPlugin = require('vue-loader/lib/plugin');

module.exports = {
devtool: "#inline-source-map",
Expand Down Expand Up @@ -54,15 +55,15 @@ module.exports = {
name: "images/[name]-[hash:6].[ext]",
limit: 10000
}
},
},
{
test: /\.png$/,
loader: "url-loader",
options: {
name: "images/[name]-[hash:6].[ext]",
limit: 10000
}
},
},
{
test: /\.jpg$/,
loader: "file-loader",
Expand All @@ -78,7 +79,7 @@ module.exports = {
limit: 10000,
prefix: "font/"
}
},
},
{
test: /\.(ttf|eot)$/,
loader: "file-loader",
Expand All @@ -103,5 +104,6 @@ module.exports = {
},

plugins: [
new VueLoaderPlugin()
]
};
8 changes: 6 additions & 2 deletions build/webpack.dev.config.js
Expand Up @@ -10,6 +10,7 @@ baseWpConfig.entry.app.unshift("webpack-hot-middleware/client");
baseWpConfig.entry.frontend.unshift("webpack-hot-middleware/client");

module.exports = merge(baseWpConfig, {
mode: 'none',
devtool: "#inline-source-map",

module: {
Expand All @@ -21,7 +22,10 @@ module.exports = merge(baseWpConfig, {
{
test: /\.vue$/,
loader: "vue-loader"
}
}, {
test: /\.pug$/,
loader: 'pug-plain-loader'
}
]
},

Expand All @@ -31,6 +35,6 @@ module.exports = merge(baseWpConfig, {

plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
new webpack.NoEmitOnErrorsPlugin()
]
});
80 changes: 46 additions & 34 deletions build/webpack.prod.config.js
Expand Up @@ -6,68 +6,80 @@ let webpack = require("webpack");
let merge = require("webpack-merge");
let baseWpConfig = require("./webpack.base.config");
//let StatsPlugin = require("stats-webpack-plugin");
let ExtractTextPlugin = require("extract-text-webpack-plugin");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = merge(baseWpConfig, {
mode: 'production',
module: {
rules: [
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [{
loader: "css-loader"/*,
use: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: {
modules: true
}*/
}, {
loader: "postcss-loader"
}, {
loader: "sass-loader"
}]
})
modules: true,
sourceMap: true,
importLoader: 2
}
},
"sass-loader"
]
}, {
test: /\.vue$/,
loader: "vue-loader",
options: {
loaders: {
sass: ExtractTextPlugin.extract({
fallback: "vue-style-loader",
use: [{
loader: "css-loader"/*,
sass: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: {
modules: true
}*/
}, {
loader: "postcss-loader"
}, {
loader: "sass-loader"
}]
})
modules: true,
sourceMap: true,
importLoader: 2
}
},
"sass-loader"
]
}
}
}, {
test: /\.pug$/,
loader: 'pug-plain-loader'
}
]
},
optimization: {
splitChunks: {
cacheGroups: {
vendor: {
chunks: "initial",
test: "vendor",
name: "vendor",
enforce: true
}
}
},
minimizer: [
new UglifyJsPlugin({
warningsFilter: (src) => true
})
]
},
plugins: [
new webpack.DefinePlugin({
"process.env": {
"NODE_ENV": JSON.stringify("production")
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendor"
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
}),

new ExtractTextPlugin("styles/[name].css")
new MiniCssExtractPlugin("styles/[name].css")

/*new StatsPlugin(path.resolve(__dirname, "stats.json"), {
chunkModules: true
Expand Down

0 comments on commit d3f95a5

Please sign in to comment.