UNPKG

react-dadata-suggestions-fork-onblur-autocomplete

Version:

Just another one react component for dadata suggestions

50 lines (47 loc) 1.32 kB
const path = require('path'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); const extractLess = new ExtractTextPlugin({ filename: "styles.css", disable: process.env.NODE_ENV === "development" }); module.exports = { entry: ['./src/index.js'], output: { path: path.resolve(__dirname, 'dist'), filename: 'index.js', libraryTarget: 'commonjs2' // THIS IS THE MOST IMPORTANT LINE! :mindblow: I wasted more than 2 days until realize this was the line most important in all this guide. }, module: { rules: [ { test: /\.js$/, include: path.resolve(__dirname, 'src'), exclude: /(node_modules|bower_components|dist)/, use: { loader: 'babel-loader' } }, { test: /\.less$|\.css$/, use: extractLess.extract({ use: [{ loader: "css-loader", options: { minimize: true } }, { loader: "less-loader" }], // use style-loader in development fallback: "style-loader" }) } ] }, externals: { 'react': 'commonjs react' // this line is just to use the React dependency of our parent-testing-project instead of using our own React. }, plugins: [ extractLess ] };