ui: init windows 98 theme

This commit is contained in:
undefined committed 2021-04-05 17:35:36 +08:00
1 parent 6cae5cb7d1
commit 9524e56d01
12 files changed
+731 -58

No files matched your search

+5 -4
View File
@@ -68,6 +68,7 @@ export default function (env = {}) {
entry: {
hydro: './entry.js',
'theme.default': './theme/default.js',
'theme.98': './theme/98.js',
},
output: {
path: root('public'),
@@ -75,8 +76,8 @@ export default function (env = {}) {
hashFunction: 'sha1',
hashDigest: 'hex',
hashDigestLength: 10,
filename: '[name].js?[chunkhash]',
chunkFilename: '[name].chunk.js?[chunkhash]',
filename: '[name].js?[hash]',
chunkFilename: '[name].chunk.js?[hash]',
},
resolve: {
modules: [root('node_modules'), root('../../node_modules')],
@@ -119,7 +120,7 @@ export default function (env = {}) {
React: 'react',
}),
new ExtractCssPlugin({
filename: '[name].css?[contenthash:10]',
filename: '[name].css?[hash:10]',
}),
new webpack.LoaderOptionsPlugin({
test: /\.styl$/,
@@ -136,7 +137,7 @@ export default function (env = {}) {
new CopyWebpackPlugin({
patterns: [
{ from: root('static') },
{ from: root(dirname(require.resolve('emojify.js/package.json')) + '/dist/images/basic'), to: 'img/emoji/' },
{ from: root(`${dirname(require.resolve('emojify.js/package.json'))}/dist/images/basic`), to: 'img/emoji/' },
],
}),
new webpack.DefinePlugin({
+3 -2
View File
@@ -1,6 +1,7 @@
require('@babel/register')({
"plugins": ["@babel/plugin-transform-runtime"],
"presets": [["@babel/preset-env", { "loose": true }]]
plugins: ['@babel/plugin-transform-runtime'],
presets: [['@babel/preset-env', { loose: true }]],
});
const main = require('./main.js');
if (!module.parent) main();
+17 -1
View File
@@ -1,6 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import { argv } from 'yargs';
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import gulp from 'gulp';
import log from 'fancy-log';
import chalk from 'chalk';
@@ -8,8 +9,23 @@ import root from './utils/root';
import gulpConfig from './config/gulp';
import webpackConfig from './config/webpack';
function runWebpack({ watch, production, measure }) {
function runWebpack({
watch, production, measure, dev,
}) {
const compiler = webpack(webpackConfig({ watch, production, measure }));
if (dev) {
const server = new WebpackDevServer(compiler, {
compress: true,
hot: true,
stats: 'errors-warnings',
index: '',
proxy: {
context: () => true,
target: 'http://localhost:2333',
},
});
return server.listen(8000);
}
return new Promise((resolve, reject) => {
function compilerCallback(err, stats) {
if (err) {