Skip to content

Instantly share code, notes, and snippets.

@gantoine
Last active April 9, 2018 20:18
Show Gist options
  • Save gantoine/b00c36d0927deb974af441094ff65573 to your computer and use it in GitHub Desktop.
Save gantoine/b00c36d0927deb974af441094ff65573 to your computer and use it in GitHub Desktop.
A simple Webpack configuration file
import { resolve } from 'path';
module.exports = env => {
const config = {
context: resolve('src/js'),
entry: {
main: ['babel-polyfill', './app.js'],
},
output: {
path: resolve('public/dist'),
filename: '[name].js',
publicPath: '/dist/',
},
plugins: [],
module: {
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.hbs$/,
use: {
loader: 'handlebars-loader',
},
},
]
},
resolve: {
modules: [resolve('./frontend/js')],
extensions: ['.js', '.hbs'],
}
};
return config;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment