wewechat++ init
仓库提交至星火社区作品集 Signed-off-by: Riceneeder <86492950+Riceneeder@users.noreply.github.com>
This commit is contained in:
35
scripts/dev.js
Normal file
35
scripts/dev.js
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
/**
|
||||
* Setup and run the development server for Hot-Module-Replacement
|
||||
* https://webpack.github.io/docs/hot-module-replacement-with-webpack.html
|
||||
* @flow
|
||||
*/
|
||||
import express from 'express';
|
||||
import webpack from 'webpack';
|
||||
import webpackDevMiddleware from 'webpack-dev-middleware';
|
||||
import webpackHotMiddleware from 'webpack-hot-middleware';
|
||||
|
||||
import config from '../config';
|
||||
import webpackConfig from '../config/webpack.config.dev';
|
||||
|
||||
const app = new express();
|
||||
const compiler = webpack(webpackConfig);
|
||||
|
||||
app.use(
|
||||
webpackDevMiddleware(compiler, {
|
||||
publicPath: webpackConfig.output.publicPath,
|
||||
stats: {
|
||||
colors: true
|
||||
},
|
||||
})
|
||||
);
|
||||
app.use(webpackHotMiddleware(compiler));
|
||||
|
||||
app.listen(config.server.port, config.server.host, err => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`Server is running with port ${config.server.port} 👏`);
|
||||
});
|
||||
10
scripts/publish.sh
Normal file
10
scripts/publish.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$GH_TOKEN" ]; then
|
||||
echo "You must set the GH_TOKEN environment variable."
|
||||
echo "See README.md for more details."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# This will build, package and upload the app to GitHub.
|
||||
npm run build && node_modules/.bin/build --projectDir ./dist --win --mac --linux -p always
|
||||
Reference in New Issue
Block a user