Files
LittleCo a41d671365 feat(hippy-react-web): perfect hippy-react-web components (#1427)
* feat(hippy-react-web): supports hippy-react components

* feat(hippy-react-web): fix cr issues

* feat(hippy-react-web): add boxShadow

* feat(hippy-react-web): add textShadow

* feat(hippy-react-web): update ScrollView & demo Slider

* feat(hippy-react-web): fix tabHost scroll

* feat(hippy-react-web): add Localization

* feat(hippy-react-web): NetInfo & websocket

* feat(hippy-react-web): networkModule

* feat(hippy-react-web): fix pullHeader

* feat(hippy-react-web): add refreshWrapper

* feat(hippy-react-web): fix useLayout

* feat(hippy-react-web): add AsyncStorage

* feat(hippy-react-web): color transform

* feat(hippy-react-web): fix device.screen in safari

* feat(hippy-react-web): rm pullHeader getPullHeaderHeight prop

* feat(hippy-react-web): rm pullHeader getPullHeaderHeight prop

* feat(hippy-react-web): local image

* feat(hippy-react-web): code improve & add Modal animation

* feat(hippy-react-web): support modal animated

* feat(hippy-react-web): refactor viewpager

* feat(hippy-react-web): add warn when use unsupported prop

* feat(hippy-react-web): add asyncStorage methods

* feat(hippy-react-web): add ImageLoaderModule

* feat(hippy-react-web): add Image getSize prefetch

* feat(hippy-react-web): PixelRatio & docs

* feat(hippy-react-web): callNative add init function

* docs(video): change to gif

* docs(debug): perf debug steps introduction

* fix(core): fix log delegate crash

* refactor(core): refactor log delegate and remove lock for log

* feat(hippy-react-web): rm demo code & add RippleViewAndroid export

* feat(hippy-react-web): update components docs

* feat(hippy-react-web): add license header

* feat(hippy-react-web): update hippy-react docs

* feat(hippy-react-web): rm list-view prop

* feat(hippy-react-web): tranform linear-gradient

* feat(hippy-react-web): add view unsupported method  warning

* feat(ios): localstorage can handle error

* fix(ios): fix value fetch error

* fix(hippy-react-web): fix cr issues

* chore(hippy-react-web): rm unused console

* docs(hippy-vue-web): update react-web components

* chore(hippy-react-web): fix listview & modal issues

* chore(hippy-react-web): rm unused console

* refactor(hippy-react-web): refactor Image

* fix(hippy-react-web): fix image resizeMode

* fix(hippy-react-web): fix rippleViewAndroid error

* docs(hippy-react-web): add hippy-react-web module info

* refactor(hippy-react-web): rename prop to props

* fix(hippy-react-web): onAppear observeer

* feat(hippy-react-web): publish react-web@14.0-beta.1

* feat(hippy-react-web): fix uiM issues & fix typo

* chore(hippy-react-demo): support web dev hot reload

* chore(hippy-react-web): add source-map

* chore(hippy-react-web): rm ts hotreload

* chore(ios): recover ios localStorage

Co-authored-by: corinli <corinli@tencent.com>
Co-authored-by: zoomchan-cxj <zoom_chan@163.com>
Co-authored-by: pollyzhang <pollyzhang@tencent.com>
Co-authored-by: mengyanluo <mengyanluo@tencent.com>
2022-04-17 21:33:54 +08:00

110 lines
3.1 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const ReactRefreshWebpackPlugin = require('@hippy/hippy-react-refresh-webpack-plugin');
const pkg = require('../package.json');
const platform = 'web';
module.exports = {
mode: 'development',
bail: true,
devServer: {
port: 38988,
hot: true,
liveReload: true,
},
devtool: 'source-map',
entry: {
index: ['regenerator-runtime', path.resolve(pkg.main)],
},
output: {
filename: `[name].${platform}.js`,
path: path.resolve(`./dist/${platform}/`),
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
__PLATFORM__: JSON.stringify(platform),
}),
new HtmlWebpackPlugin({
title: pkg.name,
filename: `${pkg.name}.html`,
template: path.resolve(__dirname, './template.html'),
favouriteIcon: pkg.favicon || 'https://hippyjs.org/assets/img/hippy-logo.ico',
}),
new CaseSensitivePathsPlugin(),
new ReactRefreshWebpackPlugin(),
],
module: {
rules: [
{
test: /\.(jsx?)$/,
use: [
{
loader: 'babel-loader',
options: {
sourceType: 'unambiguous',
presets: [
'@babel/preset-react',
[
'@babel/preset-env',
{
targets: {
chrome: 57,
ios: 8,
},
},
],
],
plugins: [
['@babel/plugin-proposal-class-properties'],
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-transform-runtime', { regenerator: true }],
require.resolve('react-refresh/babel'),
],
},
},
],
},
{
test: /\.(png|jpe?g|gif)$/i,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'assets/',
},
}],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
modules: [path.resolve(__dirname, '../node_modules')],
alias: (() => {
const aliases = {
'@hippy/react': '@hippy/react-web',
};
// If hippy-react-web was built exist then make a alias to @hippy/react
// Remove the section if you don't use it
const hippyReactPath = path.resolve(__dirname, '../../../packages/hippy-react-web');
if (fs.existsSync(path.resolve(hippyReactPath, 'dist/index.js'))) {
console.warn(`* Using the @hippy/react in ${hippyReactPath}`);
aliases['@hippy/react'] = hippyReactPath;
} else {
console.warn('* Using the @hippy/react defined in package.json');
}
return aliases;
})(),
},
};