UNPKG

react-typeahead-tokenizer

Version:

React-based typeahead and typeahead-tokenizer

55 lines (52 loc) 1.58 kB
'use strict'; const pathJoin = require('path').join; const wpUglifyJsPlugin = require('webpack').optimize.UglifyJsPlugin; const wpDefinePlugin = require('webpack').DefinePlugin; const wpLoaderOptionsPlugin = require('webpack').LoaderOptionsPlugin; module.exports = () => { const PATH_APP_ENTRY = pathJoin(__dirname, 'src'); const PATH_OUTPUT = pathJoin(__dirname, 'dist'); return Object.assign({}, { entry: { app: [PATH_APP_ENTRY], }, output: { path: PATH_OUTPUT, filename: 'react-typeahead.js', libraryTarget: 'commonjs' }, module: { rules: [ { test: /\.js$/, include: [ pathJoin(PATH_APP_ENTRY), ], exclude: [], loader: 'babel-loader', options: { presets: ['react', 'es2015', 'stage-0'], plugins: [], }, }, ], }, plugins: [ new wpDefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production') }, }), new wpUglifyJsPlugin({ compress: { warnings: false, unused: true, dead_code: true }, output: { comments: false } }) ], }); };