Fix dev build

Closes #340
This commit is contained in:
willyb321
2018-08-19 06:59:28 +10:00
parent 0ac44ac267
commit 0eb9a2048d

View File

@@ -1,22 +1,22 @@
const path = require('path') const path = require('path');
const exec = require('child_process').exec const exec = require('child_process').exec;
const webpack = require('webpack') const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin') const ExtractTextPlugin = require('extract-text-webpack-plugin');
const WebpackNotifierPlugin = require('webpack-notifier') const WebpackNotifierPlugin = require('webpack-notifier');
const pkgJson = require('./package') const pkgJson = require('./package');
const buildDate = new Date();
function CopyDirPlugin(source, destination) { function CopyDirPlugin(source, destination) {
this.source = source this.source = source;
this.destination = destination this.destination = destination;
} }
CopyDirPlugin.prototype.apply = function(compiler) { CopyDirPlugin.prototype.apply = function(compiler) {
compiler.plugin('done', () => { compiler.plugin('done', () => {
console.log(compiler.outputPath, this.destination) console.log(compiler.outputPath, this.destination);
exec('cp -r ' + this.source + ' ' + path.join(compiler.outputPath, this.destination)) exec('cp -r ' + this.source + ' ' + path.join(compiler.outputPath, this.destination));
}) });
} };
module.exports = { module.exports = {
devtool: 'source-map', devtool: 'source-map',
@@ -46,6 +46,7 @@ module.exports = {
inject: false, inject: false,
template: path.join(__dirname, 'src/index.ejs'), template: path.join(__dirname, 'src/index.ejs'),
version: pkgJson.version, version: pkgJson.version,
date: buildDate,
gapiKey: process.env.CORIOLIS_GAPI_KEY || '' gapiKey: process.env.CORIOLIS_GAPI_KEY || ''
}), }),
new ExtractTextPlugin({ new ExtractTextPlugin({
@@ -69,4 +70,4 @@ module.exports = {
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=image/svg+xml' } { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=image/svg+xml' }
] ]
} }
} };