mirror of
https://github.com/strapi/strapi.git
synced 2025-11-25 06:30:21 +00:00
Prepare plugin for build
This commit is contained in:
parent
8999142de4
commit
f22f1f303a
@ -4,6 +4,11 @@
|
|||||||
"controller": "SettingsManager",
|
"controller": "SettingsManager",
|
||||||
"action": "find",
|
"action": "find",
|
||||||
"policies": []
|
"policies": []
|
||||||
|
},
|
||||||
|
"GET /plugins/settingsmanager/:file": {
|
||||||
|
"controller": "SettingsManager",
|
||||||
|
"action": "file",
|
||||||
|
"policies": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const sendfile = require('koa-sendfile');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A set of functions called "actions" for `SettingsManager`
|
* A set of functions called "actions" for `SettingsManager`
|
||||||
*/
|
*/
|
||||||
@ -8,6 +11,11 @@ module.exports = {
|
|||||||
|
|
||||||
find: function *() {
|
find: function *() {
|
||||||
this.body = [];
|
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
|
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
|
||||||
output: {
|
output: {
|
||||||
filename: '[name].[chunkhash].js',
|
filename: '[name].js',
|
||||||
chunkFilename: '[name].[chunkhash].chunk.js',
|
chunkFilename: '[name].[chunkhash].chunk.js',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user