Skip to content

Instantly share code, notes, and snippets.

@dclarke-modus
Created October 26, 2017 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dclarke-modus/bded71e5b1d31fa8b483746784462964 to your computer and use it in GitHub Desktop.
Save dclarke-modus/bded71e5b1d31fa8b483746784462964 to your computer and use it in GitHub Desktop.
//ERROR
ERROR in ./app/index.js
Module parse failed: /home/vagrant/Projects/com_oauth_manager/media/com_oauth_manager/js/com_oauthmanager/app/index.js Unexpected token (6:16)
You may need an appropriate loader to handle this file type.
| var App = require('./component/App');
|
| ReactDOM.render(<App />, document.getElementById('oauth-manager'));
//WEBPACK.CONFIG.JS
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry : __dirname + '/app/index.js',
module : {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
],
rules: [
{
test: /\.s?css$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
}
]
},
output: {
filename : 'bundled.js',
path : __dirname + '/build'
},
watch: true,
watchOptions: {
aggregateTimeout: 300,
poll: 200
},
plugins: [
new ExtractTextPlugin("styles.css")
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment