简体   繁体   中英

Can't find static files on disc for webpack-dev-server

I'm new to Webpack and running a solution based on Angular-seed for Angular 2 which uses Webpack and the Webpack development server.

Locally everything is running fine but I can't find where any of the built static files are being saved. eg I run the site locally and the file main.bundle.js is downloaded from localhost on the configured port 3000, but that file doesn't exist anywhere on disc according to Windows Explorer "Search" functionality.

The webpack dev server is configured using Output as follows: output: { publicPath: '', path: path.resolve(__dirname, './dist'), },

which according to what I've read should create static files in the "dist" folder instead of the default "build" folder, but there is no "dist" folder I can find. I can change this "dist" folder to "gobbledygook" and that's not found either.

There is obviously a main.bundle.js, created by Webpack, being served up from somewhere but Explorer can't find it. This all seems pretty basic but I'm just drawing a blank line when I read the WebPack documentation and google it. What am I missing? Is this stuff being served from memory? If so how do I force webpack to give me real static files I can deploy to a non-Node web server?

Hi are you simply running or issuing the build command as well. Please look at your package.json and find scripts section. Example webpack starter i use from AngularClass has below commands, though you might not have the same starter.

 # dev
 npm run build:dev
 # production
 npm run build:prod

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM