Last active
December 4, 2016 20:51
-
-
Save RyanCCollins/6b4aafc7e5c0dcec74ea3e24ce82d1fe to your computer and use it in GitHub Desktop.
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
// From https://github.com/RyanCCollins/ryancollinsio/blob/feat_rc_elm/client/webpack.config.babel.js | |
const webpack = require('webpack'); | |
const path = require('path'); | |
const ROOT_PATH = path.resolve(__dirname); | |
module.exports = { | |
devtool: 'eval', | |
entry: [ | |
'react-hot-loader/patch', | |
'webpack-dev-server/client?http://localhost:1337', | |
'webpack/hot/only-dev-server', | |
path.resolve(ROOT_PATH, 'app/src/index'), | |
], | |
output: { | |
path: path.resolve(ROOT_PATH, 'app/build'), | |
publicPath: '/', | |
filename: 'bundle.js', | |
}, | |
module: { | |
noParse: /\.elm$/, | |
preLoaders: [ | |
{ | |
test: /\.jsx?$/, | |
loaders: ['eslint'], | |
include: path.resolve(ROOT_PATH, './app') | |
}, | |
{ | |
test: /\.elm$/, | |
loader: 'elmx-webpack-preloader', | |
include: [path.join(__dirname, 'app/src/elm')], | |
query: { | |
sourceDirectories: ['app/src/elm'], | |
outputDirectory: '.tmp/elm' | |
} | |
} | |
], | |
loaders: [{ | |
test: /\.jsx?$/, | |
exclude: /node_modules/, | |
loaders: ['babel'] | |
}, | |
{ | |
test: /\.elm$/, | |
exclude: [/elm-stuff/, /node_modules/], | |
include: [path.join(__dirname, "/app/src/elm"), path.join(__dirname, ".tmp/elm")], | |
loader: 'elm-hot!elm-webpack?verbose=true&warn=true&debug=true' | |
}, | |
// Removed for brevity | |
] | |
}, | |
resolve: { | |
extensions: ['', '.js', '.jsx', '.json', '.elm'], | |
alias: { | |
// Removed for brevity | |
elm: path.resolve(ROOT_PATH, 'app/src/elm'), // Create an alias for the elm directory | |
}, | |
}, | |
plugins: [ | |
// Removed for brevity | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment