1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-01 08:18:45 +09:00
This commit is contained in:
syuilo 2018-01-01 02:08:41 +09:00
parent 727ecf86b9
commit 88e4f1b287
5 changed files with 24 additions and 7 deletions

View File

@ -0,0 +1,13 @@
import * as fs from 'fs';
const license = fs.readFileSync(__dirname + '/../../../LICENSE', 'utf-8');
const licenseHtml = license
.replace(/\r\n/g, '\n')
.replace(/(.)\n(.)/g, '$1 $2')
.replace(/(^|\n)(.*?)($|\n)/g, '<p>$2</p>');
export {
license,
licenseHtml
};

View File

@ -0,0 +1,3 @@
h1 License
div!= common.license

View File

@ -0,0 +1,3 @@
h1 ライセンス
div!= common.license

View File

@ -4,6 +4,7 @@ import * as yaml from 'js-yaml';
import { fa } from '../../common/build/fa';
import config from '../../conf';
import { licenseHtml } from '../../common/build/license';
const constants = require('../../const.json');
export default function(): { [key: string]: any } {
@ -42,5 +43,7 @@ export default function(): { [key: string]: any } {
vars['facss'] = fa.dom.css();
vars['license'] = licenseHtml;
return vars;
}

View File

@ -2,13 +2,8 @@
* Inject license
*/
import * as fs from 'fs';
const StringReplacePlugin = require('string-replace-webpack-plugin');
const license = fs.readFileSync(__dirname + '/../../../LICENSE', 'utf-8')
.replace(/\r\n/g, '\n')
.replace(/(.)\n(.)/g, '$1 $2')
.replace(/(^|\n)(.*?)($|\n)/g, '<p>$2</p>');
import { licenseHtml } from '../../../src/common/build/license';
export default () => ({
enforce: 'pre',
@ -16,7 +11,7 @@ export default () => ({
exclude: /node_modules/,
loader: StringReplacePlugin.replace({
replacements: [{
pattern: '%license%', replacement: () => license
pattern: '%license%', replacement: () => licenseHtml
}]
})
});