UNPKG

bnbservice-checkout-embed

Version:

Embeddable app to facilitate the request of a service instance

64 lines (59 loc) 1.81 kB
const path = require("path"); const BUILD_DIR = path.resolve(__dirname, './public/build'); const APP_DIR = path.resolve(__dirname, './src'); var webpack = require('webpack'); const MODE = "development"; let config = async function () { return { mode: MODE, entry: { "bnbservice-checkout-embed": [ APP_DIR + '/index.js'], }, output: { path: BUILD_DIR, publicPath: "/build/", filename: '[name].js', library: 'BnbService', libraryTarget: 'umd', umdNamedDefine: true, }, module : { rules: [ { test: /\.jsx?/, include : [APP_DIR], loader: 'babel-loader' }, { test: /\.css$/, loader: "style-loader!css-loader" }, { test: /\.scss$/, use: [ "style-loader", // creates style nodes from JS strings "css-loader", // translates CSS into CommonJS "sass-loader" // compiles Sass to CSS ] } ] }, devServer: { historyApiFallback: true, hot: true, contentBase: path.resolve(__dirname, 'public'), inline: true, host: 'localhost', // Defaults to `localhost` port: 3004 }, plugins : [ new webpack.HotModuleReplacementPlugin(), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(MODE) } }) ] } }; module.exports = config;