chore: deploy site in netlify.app (#12)

This commit is contained in:
Amour1688
2020-06-17 19:57:37 +08:00
committed by GitHub
parent fe4f0ff48f
commit 620496f790
7 changed files with 367 additions and 59 deletions

16
scripts/dev.js Normal file
View File

@ -0,0 +1,16 @@
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const webpackConfig = require('./webpack.base.conf');
const compiler = webpack(webpackConfig);
const devServerOptions = {
inline: true,
open: true,
hot: true,
overlay: true,
};
const server = new WebpackDevServer(compiler, devServerOptions);
server.listen(8080, '127.0.0.1');

13
scripts/site.js Normal file
View File

@ -0,0 +1,13 @@
const webpack = require('webpack');
const webpackConfig = require('./webpack.base.conf');
webpack(Object.assign(webpackConfig, { mode: 'production', devtool: false }), (err, stats) => {
if (err) throw err;
process.stdout.write(`${stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false,
})}\n\n`);
});

View File

@ -0,0 +1,46 @@
const path = require('path');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
context: path.join(__dirname, '../packages/jsx-explorer'),
entry: './src/index.js',
output: {
publicPath: './',
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: 'dist/fonts/[name].[hash:7].[ext]',
},
},
{
test: /\.css$/,
use: [
'style-loader', 'css-loader',
],
},
],
},
plugins: [
new MonacoWebpackPlugin(),
new HtmlWebpackPlugin({
template: 'index.html',
filename: 'index.html',
}),
],
node: {
fs: 'empty',
},
};