no window object present webpack nodejs
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using webpack with babel to compile my ecmascript 6 code. Everything works fine but if I add certain dependeciens like the requests npm package. Here are my files: main.js import os from 'os' export class User { constructor(username) { this.username = username; } register() { console.log("registering..."); } } var client = new User("hey") console.log(user.register()); webpack config: var webpack = require('webpack') module.exports = { entry: [ './src/main.js' ], output: { path: "dist", publicPath: "/dist/", filename: "stela.js" }, watch: