Skip to content

Instantly share code, notes, and snippets.

@reggie3
Created September 20, 2017 01:51
Show Gist options
  • Save reggie3/1effd88e76b855d6bb7435320bfa893f to your computer and use it in GitHub Desktop.
Save reggie3/1effd88e76b855d6bb7435320bfa893f to your computer and use it in GitHub Desktop.
Webpack config for Braintree JS Project
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
module.exports = {
entry: './web/index.js',
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].bundle.js',
},
module: {
rules: [{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: [
['env', {
targets: {
browsers: ['last 2 versions', 'safari >= 9.3']
}
}]
]
}
}
}]
},
plugins: [
new HtmlWebpackPlugin({
template: './web/index.tpl.html',
inlineSource: '.js$',
cache: false,
}),
new HtmlWebpackInlineSourcePlugin()
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment