UNPKG

react-semantic-ui-accordion-menu

Version:
110 lines (109 loc) 2.59 kB
const path = require('path'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'build'), publicPath: "/build/", filename: 'index.js', libraryTarget: 'commonjs2' }, resolve: { extensions: [".js", ".jsx"] }, devServer: { port: 3001 }, plugins: [new BundleAnalyzerPlugin()], module: { rules: [ { test: /\.js$/, include: path.resolve(__dirname, 'src'), exclude: /(node_modules|bower_components|build)/, use: { loader: 'babel-loader', options: { // presets: ['env'] } } }, { test: /\.css$/, use: ['style-loader', 'css-loader'], }, { test: /\.(eot|otf|ttf|woff|woff2)$/, use: 'url-loader', }, { test: /\.svg$/, use: [ { loader: 'svg-url-loader', options: { // Inline files smaller than 10 kB limit: 10 * 1024, noquotes: true, }, }, ], }, { test: /\.(jpg|png|gif)$/, use: [ { loader: 'url-loader', options: { // Inline files smaller than 10 kB limit: 10 * 1024, }, }, { loader: 'image-webpack-loader', options: { mozjpeg: { enabled: false, // NOTE: mozjpeg is disabled as it causes errors in some Linux environments // Try enabling it in your environment by switching the config to: // enabled: true, // progressive: true, }, gifsicle: { interlaced: false, }, optipng: { optimizationLevel: 7, }, pngquant: { quality: '65-90', speed: 4, }, }, }, ], }, ] }, externals: { react: { root: 'React', commonjs2: 'react', commonjs: 'react', amd: 'react', umd: 'react', }, 'react-dom': { root: 'ReactDOM', commonjs2: 'react-dom', commonjs: 'react-dom', amd: 'react-dom', umd: 'react-dom', }, "styled-components": { commonjs: "styled-components", commonjs2: "styled-components", amd: "styled-components", }, }, };