Prepare plugin for build

This commit is contained in:
Pierre BURGY 2016-08-31 12:24:16 +02:00
parent 8999142de4
commit f22f1f303a
3 changed files with 14 additions and 1 deletions

View File

@ -4,6 +4,11 @@
"controller": "SettingsManager",
"action": "find",
"policies": []
},
"GET /plugins/settingsmanager/:file": {
"controller": "SettingsManager",
"action": "file",
"policies": []
}
}
}

View File

@ -1,5 +1,8 @@
'use strict';
const sendfile = require('koa-sendfile');
const path = require('path');
/**
* A set of functions called "actions" for `SettingsManager`
*/
@ -8,6 +11,11 @@ module.exports = {
find: function *() {
this.body = [];
},
file: function *() {
yield sendfile(this, path.resolve(__dirname, '..', 'public', 'build', this.params.file));
if (!this.status) this.throw(404);
}
};

View File

@ -18,7 +18,7 @@ module.exports = require('./webpack.base.babel')({
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
output: {
filename: '[name].[chunkhash].js',
filename: '[name].js',
chunkFilename: '[name].[chunkhash].chunk.js',
},