mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Prepare plugin for build
This commit is contained in:
parent
8999142de4
commit
f22f1f303a
@ -4,6 +4,11 @@
|
||||
"controller": "SettingsManager",
|
||||
"action": "find",
|
||||
"policies": []
|
||||
},
|
||||
"GET /plugins/settingsmanager/:file": {
|
||||
"controller": "SettingsManager",
|
||||
"action": "file",
|
||||
"policies": []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@ -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',
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user