Last active
August 2, 2018 04:22
-
-
Save awareness481/e868cf7c8f38a877bf626566b34f5923 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = { | |
entry: './src/app.js', | |
target: 'web', | |
node: { | |
fs: 'empty' | |
}, | |
output: { | |
path: path.join(__dirname, 'public'), | |
filename: 'bundle.js', | |
publicPath: '/public/' | |
}, | |
module: { | |
rules: [{ | |
test: /\.(html)$/, | |
use: { | |
loader: 'html-loader', | |
options: { | |
attrs: [':data-src'] | |
} | |
}, | |
test: /\.js$/, | |
include: path.join(__dirname, 'src'), | |
exclude: [ /(node_modules|bower_components)/, | |
'./src/server.js', | |
'./src/srv-compiled.js' | |
], | |
use: { | |
loader: 'babel-loader', | |
options: { | |
presets: ['env'] | |
} | |
} | |
}] | |
}, | |
module: { | |
rules: [{ | |
test: /\.scss$/, | |
use: [ | |
"style-loader", // creates style nodes from JS strings | |
"css-loader", // translates CSS into CommonJS | |
"sass-loader" // compiles Sass to CSS | |
], | |
test: /\.(png|jpg|gif)$/, | |
use: [ | |
{ | |
loader: 'file-loader', | |
options: { | |
publicPath: '.', | |
} | |
} | |
], | |
}] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment