Last active
May 24, 2018 14:45
-
-
Save bishesh16/fa0c0aa38c330d27b80068ce7d9ef2a2 to your computer and use it in GitHub Desktop.
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
var webpack = require('webpack'); | |
var config = { | |
context: __dirname + '/src', // `__dirname` is root of project and `/src` is source | |
entry: { | |
app: './main.js', | |
}, | |
output: { | |
path: __dirname + '/dist', // `/dist` is the destination | |
filename: 'bundle.js', // bundle created by webpack it will contain all our app logic. we will link to this .js file from our html page. | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, // rule for .js files | |
exclude: /node_modules/, | |
loader: "babel-loader" // apply this loader for js files | |
}, | |
{ | |
test: /\.css$/, | |
use: [ | |
'style-loader', // the order is important. it executes in reverse order ! | |
'css-loader' // this will load first ! | |
] | |
} | |
] | |
} | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment