wip
This commit is contained in:
@ -1,10 +0,0 @@
|
||||
import * as os from 'os';
|
||||
import * as webpack from 'webpack';
|
||||
|
||||
export default version => new webpack.BannerPlugin({
|
||||
banner:
|
||||
`Misskey v${version} | MIT Licensed, (c) syuilo 2014-2018\n` +
|
||||
'https://github.com/syuilo/misskey\n' +
|
||||
`built by ${os.hostname()} at ${new Date()}\n` +
|
||||
'hash:[hash], chunkhash:[chunkhash]'
|
||||
});
|
@ -7,6 +7,7 @@ import * as webpack from 'webpack';
|
||||
import version from '../../src/version';
|
||||
const constants = require('../../src/const.json');
|
||||
import config from '../../src/conf';
|
||||
import { licenseHtml } from '../../src/common/build/license';
|
||||
|
||||
export default lang => {
|
||||
const consts = {
|
||||
@ -24,6 +25,7 @@ export default lang => {
|
||||
_LANG_: lang,
|
||||
_HOST_: config.host,
|
||||
_URL_: config.url,
|
||||
_LICENSE_: licenseHtml
|
||||
};
|
||||
|
||||
const _consts = {};
|
||||
@ -32,7 +34,5 @@ export default lang => {
|
||||
_consts[key] = JSON.stringify(consts[key]);
|
||||
});
|
||||
|
||||
return new webpack.DefinePlugin(Object.assign({}, _consts, {
|
||||
__CONSTS__: JSON.stringify(consts)
|
||||
}));
|
||||
return new webpack.DefinePlugin(_consts);
|
||||
};
|
||||
|
@ -1,17 +1,16 @@
|
||||
const StringReplacePlugin = require('string-replace-webpack-plugin');
|
||||
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
|
||||
|
||||
import consts from './consts';
|
||||
import hoist from './hoist';
|
||||
import minify from './minify';
|
||||
import banner from './banner';
|
||||
|
||||
const env = process.env.NODE_ENV;
|
||||
const isProduction = env === 'production';
|
||||
|
||||
export default (version, lang) => {
|
||||
const plugins = [
|
||||
consts(lang),
|
||||
new StringReplacePlugin()
|
||||
new HardSourceWebpackPlugin(),
|
||||
consts(lang)
|
||||
];
|
||||
|
||||
if (isProduction) {
|
||||
@ -19,7 +18,5 @@ export default (version, lang) => {
|
||||
plugins.push(minify());
|
||||
}
|
||||
|
||||
plugins.push(banner(version));
|
||||
|
||||
return plugins;
|
||||
};
|
||||
|
Reference in New Issue
Block a user