Skip to content

Commit

Permalink
build process ready for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jsardev committed Jan 12, 2018
1 parent 2836112 commit c49ebda
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 18 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="utf-8">
<title>training-vuejs</title>
<title>Development - Stock Trader</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"cross-env": "^5.0.5",
"css-loader": "^0.28.7",
"file-loader": "^1.1.4",
"html-webpack-include-assets-plugin": "^1.0.2",
"html-webpack-plugin": "^2.30.1",
"pug": "^2.0.0-rc.4",
"vue-loader": "^13.0.5",
"vue-template-compiler": "^2.4.4",
Expand Down
12 changes: 12 additions & 0 deletions src/App.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
</head>

<body>
<div id="app"></div>
</body>

</html>
42 changes: 25 additions & 17 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var path = require('path')
var webpack = require('webpack')
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackIncludeAssetsPlugin = require('html-webpack-include-assets-plugin');

module.exports = {
entry: './src/main.js',
Expand All @@ -12,18 +14,11 @@ module.exports = {
rules: [
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
],
}, {
use: ['vue-style-loader', 'css-loader']
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
}
// other vue-loader options go here
}
loader: 'vue-loader'
},
{
test: /\.js$/,
Expand All @@ -41,7 +36,7 @@ module.exports = {
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
vue$: 'vue/dist/vue.esm.js'
},
extensions: ['*', '.js', '.vue', '.json']
},
Expand All @@ -54,10 +49,12 @@ module.exports = {
hints: false
},
devtool: '#eval-source-map'
}
};

if (process.env.NODE_ENV === 'production') {
module.exports.devtool = '#source-map'
delete module.exports.output.publicPath;

module.exports.devtool = '#source-map';
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
Expand All @@ -73,6 +70,17 @@ if (process.env.NODE_ENV === 'production') {
}),
new webpack.LoaderOptionsPlugin({
minimize: true
}),
new HtmlWebpackPlugin({
title: 'Stock Trader',
template: 'src/App.html'
}),
new HtmlWebpackIncludeAssetsPlugin({
assets: [
'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css',
'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'
],
append: false
})
])
]);
}

0 comments on commit c49ebda

Please sign in to comment.