Skip to content

Commit 863fef8

Browse files
committed
chore(client): export logger that is bundled with babel
1 parent 0afc8c6 commit 863fef8

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

client-src/default/utils/log.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const log = require('webpack/lib/logging/runtime');
3+
const log = require('../../log');
44

55
const name = 'webpack-dev-server';
66
const defaultLevel = 'info';

client-src/log/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
module.exports = require('webpack/lib/logging/runtime');

client-src/log/webpack.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict';
2+
3+
const path = require('path');
4+
5+
module.exports = {
6+
mode: 'production',
7+
entry: path.join(__dirname, 'index.js'),
8+
output: {
9+
path: path.resolve(__dirname, '../../client/log'),
10+
filename: 'index.js',
11+
libraryTarget: 'commonjs2',
12+
},
13+
module: {
14+
rules: [
15+
{
16+
test: /\.js$/,
17+
use: [
18+
{
19+
loader: 'babel-loader',
20+
},
21+
],
22+
},
23+
],
24+
},
25+
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"build:client:clients": "babel client-src/clients --out-dir client/clients",
3131
"build:client:index": "webpack --color --config client-src/default/webpack.config.js",
3232
"build:client:sockjs": "webpack --color --config client-src/sockjs/webpack.config.js",
33+
"build:client:log": "webpack --color --config client-src/log/webpack.config.js",
3334
"build:client": "rimraf ./client/* && npm-run-all -s -l -p \"build:client:**\"",
3435
"webpack-dev-server": "node examples/run-example.js",
3536
"release": "standard-version"

0 commit comments

Comments
 (0)