mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-01-12 22:46:30 +08:00
* Make error overlay to run in the context of the iframe * Configure webpack to build the entire package * Remove inline raw-loader config * Configure watch mode for error-overlay webpack build * Add polyfills to the error-overlay iframe script * Add header comment * Configure to fail CI on error or warning * Suppress flow-type error on importing iframe-bundle * Change webpack to a dev dependency and pin some versions * Disable webpack cache * Update license headers to MIT
39 lines
807 B
JavaScript
39 lines
807 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
'use strict';
|
|
|
|
const path = require('path');
|
|
|
|
module.exports = {
|
|
devtool: 'cheap-module-source-map',
|
|
entry: './src/index.js',
|
|
output: {
|
|
path: path.join(__dirname, './lib'),
|
|
filename: 'index.js',
|
|
library: 'ReactErrorOverlay',
|
|
libraryTarget: 'umd',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /iframe-bundle\.js$/,
|
|
use: 'raw-loader',
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
include: path.resolve(__dirname, './src'),
|
|
use: 'babel-loader',
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
iframeScript$: path.resolve(__dirname, './lib/iframe-bundle.js'),
|
|
},
|
|
},
|
|
};
|