Skip to content

Instantly share code, notes, and snippets.

@comfortablejohn
Created August 10, 2017 07:55
Show Gist options
  • Save comfortablejohn/ff78a69f6caae441facc46d059fc49e0 to your computer and use it in GitHub Desktop.
Save comfortablejohn/ff78a69f6caae441facc46d059fc49e0 to your computer and use it in GitHub Desktop.
Webpack Config for Preact (JSX)
module.exports = {
entry: './src/js/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'app.bundle.js',
},
devtool: 'source-map',
module: {
rules: [{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src/js/')
],
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['env'],
plugins: [["transform-react-jsx", { "pragma": "h" }]]
}
}
}]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment