UNPKG

react-predictive-text

Version:
29 lines (25 loc) 670 B
var webpack = require('webpack'); var path = require('path'); var BUILD_DIR = path.resolve(__dirname); var APP_DIR = path.resolve(__dirname); var config = { entry: APP_DIR + '/react-predictive-text.jsx', output: { path: BUILD_DIR, 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|jsx)$/, exclude: /node_modules/, use: ['babel-loader'] } ] }, resolve: { extensions: ['*', '.js', '.jsx'] }, }; module.exports = config;