Skip to content
Snippets Groups Projects
Commit 7fa93c50 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #794 from metabase/asset_cache_busting

Asset cache busting
parents c9a182db 47b3fdd8
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ profiles.clj
/*.lock.db
/*.trace.db
/resources/frontend_client/app/dist/
/resources/frontend_client/index.html
/node_modules/
/.babel_cache
/coverage
......
......@@ -8,9 +8,6 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>Metabase</title>
<link rel="stylesheet" href="/app/dist/styles.bundle.css"/>
<script charset="utf-8" src="/app/dist/vendor.bundle.js"></script>
<script charset="utf-8" src="/app/dist/app.bundle.js"></script>
</head>
<body ng-controller="Corvus">
......
......@@ -7,6 +7,7 @@ var webpackPostcssTools = require('webpack-postcss-tools');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
var NgAnnotatePlugin = require('ng-annotate-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var _ = require('underscore');
var glob = require('glob');
......@@ -42,7 +43,9 @@ module.exports = {
// output to "dist"
output: {
path: __dirname + '/resources/frontend_client/app/dist',
filename: '[name].bundle.js'
// NOTE: the filename on disk won't include "?[chunkhash]" but the URL in index.html generated by HtmlWebpackPlugin will:
filename: '[name].bundle.js?[chunkhash]',
publicPath: '/app/dist'
},
module: {
......@@ -114,7 +117,13 @@ module.exports = {
minChunks: Infinity // (with more entries, this ensures that no other module goes into the vendor chunk)
}),
// Extracts initial CSS into a standard stylesheet that can be loaded in parallel with JavaScript
new ExtractTextPlugin('styles.bundle.css')
// NOTE: the filename on disk won't include "?[chunkhash]" but the URL in index.html generated by HtmlWebpackPlugin will:
new ExtractTextPlugin('[name].bundle.css?[contenthash]'),
new HtmlWebpackPlugin({
filename: '../../index.html',
template: 'resources/frontend_client/index_template.html',
inject: 'head'
})
],
// CSSNext configuration
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment