Skip to content

Instantly share code, notes, and snippets.

@qasimalyas
Created January 13, 2020 20:53
Show Gist options
  • Save qasimalyas/b6418adee6edf87cb5b8bc9a484e8ed3 to your computer and use it in GitHub Desktop.
Save qasimalyas/b6418adee6edf87cb5b8bc9a484e8ed3 to your computer and use it in GitHub Desktop.
webpack config
const path = require("path");
const webpack = require("webpack");
console.log(path.resolve(__dirname, "./Javascript/destnew"));
module.exports = {
mode: "development",
entry: {
main: "./Javascript/index.js"
},
output: {
path: path.resolve(__dirname, "Javascript/destnew"),
filename: "[name].js",
publicPath: "/Javascript/destnew/",
chunkFilename: "[name]-bundle.js"
},
devtool: "cheap-module-eval-source-map",
module: {
rules: [{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }]
},
resolve: {
modules: ["node_modules", path.resolve(__dirname, "./Javascript/")]
},
externals: {
jquery: "jQuery"
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment