-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack-docs-serve.mjs
More file actions
58 lines (45 loc) · 1.38 KB
/
webpack-docs-serve.mjs
File metadata and controls
58 lines (45 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import path from "path";
import webpack from "webpack";
import webpackDevServer from "webpack-dev-server";
import { merge } from "webpack-merge";
// import VueLoaderPlugin from 'vue-loader/lib/plugin.js';
// import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import common from "./webpack-docs.mjs";
// @ts-ignore
const config = merge(common, {
mode: "development"
// plugins: [
// new webpack.HotModuleReplacementPlugin()
// ]
});
// @ts-ignore
// const app = webpack(config);
// // app.compile(function(e){
// // console.log(e);
// // })
// app.run(function(e){
// console.log('...',e||'done');
// });
// webpack.docs
// webpack.docs.serve
// webpack.docs.build
// webpack.docs.compile
// webpack.config.docs
// const docs = new webpackDevServer(webpack(config));
// docs.listen(8080, 'localhost');
// const docs = new webpackDevServer(webpack(config), {
// contentBase: path.resolve('./docs/'),
// // publicPath: '/'
// });
// // docs.listen(8080, 'localhost');
// const Webpack = require('webpack');
// const WebpackDevServer = require('webpack-dev-server');
// const config = require('./webpack.config.js');
const compiler = webpack(config);
const devServerOptions = { ...config.devServer, open: true };
const server = new webpackDevServer(devServerOptions, compiler);
const runServer = async () => {
console.log("Starting server...");
await server.start();
};
runServer();