Last active
February 12, 2018 12:53
-
-
Save lalitmee/5752b488cd413935248fe18e8bd4c643 to your computer and use it in GitHub Desktop.
Web Pack configuration
This file contains 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
/* eslint strict: 0 */ | |
("use strict"); | |
var path = require("path"); | |
var webpack = require("webpack"); | |
module.exports = { | |
entry: "./app/app.js", | |
output: { path: __dirname + "/public" + "/js", filename: "bundle.js" }, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
loader: "babel-loader", | |
exclude: /node_modules/, | |
query: { | |
presets: ["es2015", "react"] | |
} | |
}, | |
{ | |
test: /.jsx?$/, | |
loader: "babel-loader", | |
exclude: /node_modules/, | |
query: { | |
presets: ["es2015", "react"] | |
} | |
}, | |
{ | |
test: /\.css$/, | |
use: [ | |
{ | |
loader: "style-loader" | |
}, | |
{ | |
loader: "css-loader" | |
} | |
], | |
include: /node_modules/ | |
} | |
] | |
} | |
}; | |
``` | |
Error Message | |
Hash: 396f0bfb9d565b6f60f0 | |
Version: webpack 1.12.12 | |
Time: 115ms | |
[0] ./app/app.js 0 bytes [built] [failed] | |
ERROR in ./app/app.js | |
Module parse failed: /home/lalit/Desktop/Github/Electron/simple-electron/scotch-player/app/app.js Line 3: Unexpected token | |
You may need an appropriate loader to handle this file type. | |
| // ES6 Component | |
| // Import React and ReactDOM | |
| import React from "react"; | |
| import ReactDOM from "react-dom"; | |
| import { Header, Button, Container } from "semantic-ui-react"; | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment