Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const path = require('path');
- module.exports = {
- entry: [
- './src/index.js'
- ],
- module: {
- rules: [
- {
- test: /\.(js|jsx)$/,
- include: path.resolve(__dirname, "src"),
- exclude: /node_modules/,
- use: ['babel-loader']
- },
- {
- test: /\.css$/,
- use: [{
- loader: "style-loader" // creates style nodes from JS strings
- }, {
- loader: "css-loader", // translates CSS into CommonJS
- }]
- },
- {
- test: /\.scss$/,
- use: [{
- loader: "style-loader" // creates style nodes from JS strings
- }, {
- loader: "css-loader" // translates CSS into CommonJS
- }, {
- loader: "sass-loader" // compiles Sass to CSS
- }]
- },
- {
- test: /\.svg$/,
- loader: 'svg-url-loader'
- }
- ]
- },
- resolve: {
- extensions: ['*', '.js', '.jsx'],
- modules: [path.resolve(__dirname, 'src'), 'node_modules']
- },
- output: {
- path: path.join(__dirname, './dist'),
- filename: 'bundle.js',
- libraryTarget: 'commonjs2',
- publicPath: '/dist/',
- umdNamedDefine: true
- },
- externals: {
- // Don't bundle react or react-dom
- react: {
- commonjs: "react",
- commonjs2: "react",
- amd: "React",
- root: "React"
- },
- "react-dom": {
- commonjs: "react-dom",
- commonjs2: "react-dom",
- amd: "ReactDOM",
- root: "ReactDOM"
- }
- },
- devServer: {
- contentBase: './dist'
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement