Commit c82ac91a authored by Patricio Bruna's avatar Patricio Bruna

Merge pull request #45 from ZBoxApp/bundle_with_no_cache

add config to generate html and bundle dynamically, bundle with a sim…
parents e175ee70 cf1a0d3f
module.exports = {"main":{"js":"/244695bundle.js"}}
\ No newline at end of file
...@@ -57,7 +57,6 @@ export default class DistributionLists extends React.Component { ...@@ -57,7 +57,6 @@ export default class DistributionLists extends React.Component {
if (domain) { if (domain) {
response.domain = domain; response.domain = domain;
const dl = DomainStore.getDistributionListById(id, domain); const dl = DomainStore.getDistributionListById(id, domain);
console.log(domain, dl);
response.distributionsList = dl; response.distributionsList = dl;
dl.getOwners((error, owners) => { dl.getOwners((error, owners) => {
...@@ -383,8 +382,6 @@ export default class DistributionLists extends React.Component { ...@@ -383,8 +382,6 @@ export default class DistributionLists extends React.Component {
let panelTabs; let panelTabs;
let isPrivate = null; let isPrivate = null;
console.log(this.state);
if (this.state.distributionsList && this.state.owners) { if (this.state.distributionsList && this.state.owners) {
const data = this.state.distributionsList; const data = this.state.distributionsList;
const domain = this.state.domain; const domain = this.state.domain;
......
...@@ -31,17 +31,6 @@ ...@@ -31,17 +31,6 @@
<link rel='icon' type='image/png' sizes='192x192' href='images/favicon/android-chrome-192x192.png'> <link rel='icon' type='image/png' sizes='192x192' href='images/favicon/android-chrome-192x192.png'>
<link rel='manifest' href='config/manifest.json'> <link rel='manifest' href='config/manifest.json'>
<!-- Android add to homescreen --> <!-- Android add to homescreen -->
<style id='antiClickjack'>body{display:none !important;}</style>
<script src='/bundle.js'></script>
<script type='text/javascript'>
if (self === top) {
var blocker = document.getElementById('antiClickjack');
blocker.parentNode.removeChild(blocker);
}
</script>
</head> </head>
<body class='show-sidebar'> <body class='show-sidebar'>
<div id='root'/> <div id='root'/>
......
...@@ -2,11 +2,24 @@ const webpack = require('webpack'); ...@@ -2,11 +2,24 @@ const webpack = require('webpack');
const path = require('path'); const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin');
const AssetsPlugin = require('assets-webpack-plugin');
const assetsPluginInstance = new AssetsPlugin({
filename: 'path.json',
processOutput: function (assets) {
return 'module.exports = ' + JSON.stringify(assets);
}
});
const HtmlWebpackPlugin = require('html-webpack-plugin');
const htmlExtract = new ExtractTextPlugin('html', 'index.html'); const htmlExtract = new ExtractTextPlugin('html', 'index.html');
const Instancehtmlwebpackplugin = new HtmlWebpackPlugin({template: './src/index.html', inject: 'head'});
const NPM_TARGET = process.env.npm_lifecycle_event; //eslint-disable-line no-process-env const NPM_TARGET = process.env.npm_lifecycle_event; //eslint-disable-line no-process-env
// Create a simple hash based on timestamp promp
const timestamp = new Date().getTime().toString();
const hash = timestamp.slice(-6, timestamp.length);
var DEV = false; var DEV = false;
var FULLMAP = false; var FULLMAP = false;
if (NPM_TARGET === 'run' || NPM_TARGET === 'run-fullmap') { if (NPM_TARGET === 'run' || NPM_TARGET === 'run-fullmap') {
...@@ -17,11 +30,11 @@ if (NPM_TARGET === 'run' || NPM_TARGET === 'run-fullmap') { ...@@ -17,11 +30,11 @@ if (NPM_TARGET === 'run' || NPM_TARGET === 'run-fullmap') {
} }
var config = { var config = {
entry: ['babel-polyfill', './src/index.jsx', 'src/index.html'], entry: ['babel-polyfill', './src/index.jsx'],
output: { output: {
path: 'dist', path: 'dist',
publicPath: '/', publicPath: '/',
filename: 'bundle.js' filename: hash + 'bundle.js'
}, },
module: { module: {
loaders: [ loaders: [
...@@ -61,14 +74,12 @@ var config = { ...@@ -61,14 +74,12 @@ var config = {
query: { query: {
name: 'files/[hash].[ext]' name: 'files/[hash].[ext]'
} }
},
{
test: /\.html$/,
loader: htmlExtract.extract('html?attrs=link:href')
} }
] ]
}, },
plugins: [ plugins: [
Instancehtmlwebpackplugin,
assetsPluginInstance,
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{from: 'src/config', to: 'config'} {from: 'src/config', to: 'config'}
]), ]),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment