Last active
October 22, 2015 14:06
-
-
Save nathanjsharpe/e98b3103abfe6073f837 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Trak-It Web App</title> | |
<script src="//maps.google.com/maps/api/js?v=3&sensor=false"></script> | |
<link rel="stylesheet" href="static/styles.css"> | |
</head> | |
<body id="modal-tag"> | |
<div id="app" class="content"> | |
</div> | |
<script src="static/bundle.js"></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var webpack = require('webpack'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var execSync = require('exec-sync'); | |
var definePlugin = new webpack.DefinePlugin({ | |
APP_API_URL: JSON.stringify(process.env.APP_API_URL || 'https://api.trakit.io'), | |
DATA_API_URL: JSON.stringify(process.env.DATA_API_URL || 'development'), | |
WEB_APP_URL: JSON.stringify(process.env.WEB_APP_URL || 'development') | |
}); | |
module.exports = { | |
devtools: [], | |
entry: [ | |
'./src/entry' | |
], | |
output: { | |
path: path.join(__dirname, 'build'), | |
filename: 'static/bundle.js' | |
}, | |
plugins: [ | |
new ExtractTextPlugin('static/styles.css'), | |
definePlugin, | |
new HtmlWebpackPlugin({ | |
title: 'Trakit Version', | |
template: 'src/version.html', | |
inject: false, | |
filename: 'version/index.html', | |
buildDate: Date().toString(), | |
commitHash: execSync('git rev-parse HEAD'), | |
appVersion: process.env.npm_package_version | |
}) | |
], | |
resolve: { | |
extensions: ['', '.js', '.jsx', '.json', '.scss'] | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.jsx?$/, | |
include: path.join(__dirname, 'src'), | |
loaders: ['babel'] | |
}, | |
{ | |
include: /\.json$/, | |
loaders: ["json-loader"] | |
}, | |
{ | |
test: /\.scss$/, | |
include: path.join(__dirname, 'src', 'scss'), | |
loader: ExtractTextPlugin.extract('css!sass?sourceMap') | |
}, | |
{ | |
test: /\.(png|jpg|gif)$/, | |
include: path.join(__dirname, 'src', 'images'), | |
loader: 'url-loader?limit=8192' | |
}, | |
{ | |
test: /\.(png|jpg|gif)$/, | |
include: [ | |
path.join(__dirname, 'node_modules', 'leaflet', 'dist', 'images') | |
], | |
loader: 'file?name=node_modules/leaflet/dist/images/[name].[ext]?[hash]' | |
} | |
] | |
}, | |
"node": { | |
"fs": "empty" | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var webpack = require('webpack'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var definePlugin = new webpack.DefinePlugin({ | |
APP_API_URL: JSON.stringify(process.env.APP_API_URL || 'http://api.trakit.cat'), | |
DATA_API_URL: JSON.stringify(process.env.DATA_API_URL || ''), | |
WEB_APP_URL: JSON.stringify(process.env.WEB_APP_URL || '') | |
}); | |
module.exports = { | |
devtools: ['eval'], | |
entry: [ | |
'webpack-dev-server/client?http://localhost:3000', | |
'webpack/hot/only-dev-server', | |
'./src/entry' | |
], | |
output: { | |
path: path.join(__dirname, 'build'), | |
filename: 'static/bundle.js', | |
publicPath: '' | |
}, | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin(), | |
definePlugin | |
], | |
resolve: { | |
extensions: ['', '.js', '.jsx', '.json', '.scss'] | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.jsx?$/, | |
include: path.join(__dirname, 'src'), | |
loaders: ['react-hot', 'babel'] | |
}, | |
{ | |
include: /\.json$/, | |
loaders: ["json-loader"] | |
}, | |
{ | |
test: /\.scss$/, | |
include: path.join(__dirname, 'src', 'scss'), | |
loader: "style!css!sass?sourceMap" | |
}, | |
{ | |
test: /\.(png|jpg|gif)$/, | |
include: path.join(__dirname, 'src', 'images'), | |
loader: 'url-loader?limit=8192' | |
}, | |
{ | |
test: /\.(png|jpg|gif)$/, | |
include: [ | |
path.join(__dirname, 'node_modules', 'leaflet', 'dist', 'images') | |
], | |
loader: 'file?name=node_modules/leaflet/dist/images/[name].[ext]?[hash]' | |
}] | |
}, | |
"node": { | |
"fs": "empty" | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment