12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- var webpack = require('webpack');
- var isProd = (process.env.NODE_ENV === 'production');
- module.exports = [{
- node: {fs: 'empty'},
- entry: './src/index.js',
- devtool: 'source-map',
- output: {
- path: './dist',
- filename: isProd ? 'react-simplemde-editor.min.js' : 'react-simplemde-editor.js',
- libraryTarget: 'umd'
- },
- module: {
- loaders: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- loader: "babel",
- query: {
- presets: ['react', 'es2015']
- }
- }
- ]
- }
- }, {
- node: {fs: 'empty'},
- entry: './src/index.js',
- devtool: 'source-map',
- output: {
- path: './dist',
- filename: isProd ? 'simplemde-editor.min.js' : 'simplemde-editor.js',
- libraryTarget: 'umd'
- },
- plugins: [
- new webpack.ProvidePlugin({
- React: "React", react: "React", "window.react": "React", "window.React": "React"
- }),
- ],
- resolve: {
- extensions: ['', '.js'],
- alias: {
- "react": "src/dummyReact.js"
- }
- },
- externals: {
- // Use external version of React
- react: {
- root: 'React',
- commonjs2: 'react',
- commonjs: 'react',
- amd: 'react'
- }
- },
- module: {
- noParse: ["react"],
- loaders: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- loader: "babel",
- query: {
- presets: ['react', 'es2015']
- }
- }
- ]
- }
- }
- ];
|