Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const ExtractTextPlugin = require('extract-text-webpack-plugin');
- const path = require('path');
- module.exports = {
- entry: ['./src/js/index.js'],
- output: {
- filename: 'app.bundle.js',
- path: path.resolve(__dirname, 'src/assets'),
- publicPath: '/assets/',
- },
- devtool: 'source-map',
- module: {
- rules: [{
- test: /.scss$/,
- use: ExtractTextPlugin.extract({
- fallback: 'style-loader',
- use: ['css-loader', 'sass-loader'],
- publicPath: '/assets/',
- }),
- }],
- },
- devServer: {
- contentBase: path.resolve(__dirname, 'src'),
- compress: false,
- publicPath: 'http://localhost:8080/assets/',
- // port: 8080,
- watchContentBase: true,
- public: 'app.dev',
- proxy: {
- '/api': {
- target: 'http://app.dev',
- secure: false,
- },
- },
- },
- plugins: [
- new ExtractTextPlugin({
- filename: 'app.css',
- disable: false,
- allChunks: true,
- }),
- ],
- };
- "scripts": {
- "dev": "webpack-dev-server --hot --inline --open",
- "prod": "webpack -p"
- }
- yarn run v0.19.1
- $ webpack-dev-server --open
- Project is running at http://app.dev/
- webpack output is served from http://localhost:8080/assets/
- Content not from webpack is served from /Users/hendrik/Documents/Github/Projects/app/src....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement