nanka iroiro

Closes #1168, #1169
This commit is contained in:
syuilo
2018-03-03 07:32:18 +09:00
parent 165c93b248
commit 6ba1035b69
10 changed files with 45 additions and 11 deletions

View File

@ -4,7 +4,9 @@
import * as webpack from 'webpack';
import version from '../../src/version';
const meta = require('../../package.json');
const version = meta.version;
const constants = require('../../src/const.json');
import config from '../../src/conf';
import { licenseHtml } from '../../src/common/build/license';

View File

@ -1,4 +1,7 @@
import * as fs from 'fs';
import * as webpack from 'webpack';
const WebpackOnBuildPlugin = require('on-build-webpack');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
import chalk from 'chalk';
@ -11,6 +14,7 @@ const isProduction = env === 'production';
export default (version, lang) => {
const plugins = [
new HardSourceWebpackPlugin(),
new ProgressBarPlugin({
format: chalk` {cyan.bold yes we can} {bold [}:bar{bold ]} {green.bold :percent} {gray (:current/:total)} :elapseds`,
clear: false
@ -20,6 +24,11 @@ export default (version, lang) => {
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
}
}),
new WebpackOnBuildPlugin(stats => {
fs.writeFileSync('./version.json', JSON.stringify({
version
}), 'utf-8');
})
];

View File

@ -12,7 +12,8 @@ const constants = require('../src/const.json');
import plugins from './plugins';
import langs from '../locales';
import version from '../src/version';
const meta = require('../package.json');
const version = meta.version;
global['faReplacement'] = faReplacement;
@ -59,7 +60,7 @@ module.exports = Object.keys(langs).map(lang => {
rules: [{
test: /\.vue$/,
exclude: /node_modules/,
use: [/*'cache-loader', */{
use: ['cache-loader', {
loader: 'vue-loader',
options: {
cssSourceMap: false,
@ -140,6 +141,7 @@ module.exports = Object.keys(langs).map(lang => {
use: [{
loader: 'ts-loader',
options: {
happyPackMode: true,
configFile: __dirname + '/../src/web/app/tsconfig.json',
appendTsSuffixTo: [/\.vue$/]
}