mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-21 16:26:27 +08:00
ff9f763a45
- hippy-vue: ElementNode add repaintWithChildren API - hippy-vue: support remove outdated style of HMR chunk - hippy-vue-loader: support style hmr - hippy-vue-css-loader: support remove outdated style of HMR chunk - debug-server, vue-demo, react-demo, hippy-react: support hmr - debug-server: add hippy-dev command
79 lines
1.7 KiB
JavaScript
79 lines
1.7 KiB
JavaScript
'use strict';
|
|
|
|
const path = require('path');
|
|
const webpack = require('webpack');
|
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
const { merge } = require('webpack-merge');
|
|
|
|
const library = webpack.webpack
|
|
? {
|
|
library: {
|
|
// type: "module",
|
|
type: 'commonjs',
|
|
},
|
|
}
|
|
: { libraryTarget: 'umd' };
|
|
|
|
const baseForModules = {
|
|
devtool: false,
|
|
mode: 'development',
|
|
// TODO enable this in future after fix bug with `eval` in webpack
|
|
// experiments: {
|
|
// outputModule: true,
|
|
// },
|
|
output: {
|
|
globalObject: '(0, eval)("this")',
|
|
path: path.resolve(__dirname, '../client/modules'),
|
|
...library,
|
|
},
|
|
optimization: {
|
|
minimize: false,
|
|
},
|
|
target: webpack.webpack ? ['web', 'es5'] : 'web',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
use: [
|
|
{
|
|
loader: 'babel-loader',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
};
|
|
|
|
module.exports = [
|
|
merge(baseForModules, {
|
|
entry: path.join(__dirname, 'modules/logger/index.js'),
|
|
output: {
|
|
filename: 'logger/index.js',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
use: [
|
|
{
|
|
loader: 'babel-loader',
|
|
options: {
|
|
plugins: ['@babel/plugin-transform-object-assign'],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
Symbol: '(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })',
|
|
}),
|
|
new webpack.NormalModuleReplacementPlugin(
|
|
/^tapable\/lib\/SyncBailHook/,
|
|
path.join(__dirname, 'modules/logger/SyncBailHookFake.js'),
|
|
),
|
|
],
|
|
}),
|
|
];
|