Created
September 20, 2017 01:51
-
-
Save reggie3/1effd88e76b855d6bb7435320bfa893f to your computer and use it in GitHub Desktop.
Webpack config for Braintree JS Project
This file contains hidden or 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'); | |
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