Skip to content

Instantly share code, notes, and snippets.

@msacar
Last active May 1, 2020 17:28
Show Gist options
  • Save msacar/4dbf86038c81686f92abfad9adec4010 to your computer and use it in GitHub Desktop.
Save msacar/4dbf86038c81686f92abfad9adec4010 to your computer and use it in GitHub Desktop.
const webpack = require('webpack');
const path = require('path');
const config = {
//Başlangıç noktası olan ana javascript dosyamız
entry: './src/index.js',
mode: 'development',
//Ana dosyanın transpile edilip çıktığı dizin ve dosya adı. /dist/bundle.js
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
//Js uzantısı ile biten tüm dosyaların babel loader ile
// tarayıcıların anlayacağı dile çevrilmesini sağlayan kural.
rules: [
{
test: /\.js$/,
use: {
loader :"babel-loader"
},
exclude: /node_modules/
}
]
},
//pluginleri buraya eklersiniz.
plugins: [
]
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment