mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-10 09:52:51 +00:00
dependency work
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ dist
|
||||
public
|
||||
npm-debug.log
|
||||
mywebsite
|
||||
stats.html
|
||||
@@ -8,6 +8,9 @@
|
||||
<meta name="author" content="Mitchell Gerber">
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:300,400" rel="stylesheet">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
|
||||
<script src="https://unpkg.com/react@15/dist/react.min.js"></script>
|
||||
<script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js"></script>
|
||||
<script src="https://unpkg.com/react-router/umd/ReactRouter.min.js"></script>
|
||||
<title>mitchel.io</title>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"analyze": "webpack --json | webpack-bundle-size-analyzer",
|
||||
"build": "NODE_ENV=production webpack -p --progress --colors && babel-node metadata.js",
|
||||
"c9": "webpack-dev-server --port $PORT --host $IP --hot --content-base dist --history-api-fallback",
|
||||
"check_gzip_size": "gzip -9 -c ./public/client.min.js | wc -c | numfmt --to=iec-i --suffix=B --padding=10",
|
||||
"check-gzip-size": "gzip -9 -c ./public/client.min.js | wc -c | numfmt --to=iec-i --suffix=B --padding=10",
|
||||
"deploy": "npm run get_dependencies && npm run prod && ./mywebsite",
|
||||
"dev": "webpack-dev-server --content-base public --inline --hot --history-api-fallback",
|
||||
"get_dependencies": "go get ./server && npm install",
|
||||
@@ -64,6 +64,7 @@
|
||||
"url-loader": "^0.5.7",
|
||||
"webpack": "^1.13.1",
|
||||
"webpack-dev-server": "^1.14.1",
|
||||
"webpack-visualizer-plugin": "^0.1.5",
|
||||
"whatwg-fetch": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ var webpack = require('webpack');
|
||||
var path = require('path');
|
||||
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
var autoprefixer = require('autoprefixer');
|
||||
var Visualizer = require('webpack-visualizer-plugin');
|
||||
|
||||
module.exports = {
|
||||
devtool: debug ? "inline-sourcemap" : null,
|
||||
@@ -36,7 +37,12 @@ module.exports = {
|
||||
filename: "client.min.js"
|
||||
},
|
||||
plugins: getPlugins(),
|
||||
externals:{hljs: "hljs"}
|
||||
externals:{
|
||||
"hljs": "hljs",
|
||||
"react": "React",
|
||||
"react-dom": "ReactDOM",
|
||||
"react-router": "ReactRouter"
|
||||
}
|
||||
};
|
||||
|
||||
function getPlugins(){
|
||||
@@ -49,7 +55,10 @@ function getPlugins(){
|
||||
}),
|
||||
new webpack.EnvironmentPlugin([
|
||||
"NODE_ENV"
|
||||
])
|
||||
]),
|
||||
new Visualizer({
|
||||
filename: "../stats.html"
|
||||
})
|
||||
];
|
||||
if(!debug){
|
||||
plugins = plugins.concat([
|
||||
|
||||
Reference in New Issue
Block a user