mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-07-02 10:03:25 +08:00
chore: deploy site in netlify.app (#12)
This commit is contained in:
16
scripts/dev.js
Normal file
16
scripts/dev.js
Normal 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
13
scripts/site.js
Normal 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`);
|
||||
});
|
46
scripts/webpack.base.conf.js
Normal file
46
scripts/webpack.base.conf.js
Normal 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',
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user