refactor: with TypeScript (#24)

* refactor: add ts support (#19)

Co-authored-by: 逆寒 <869732751@qq.com>
This commit is contained in:
Amour1688
2020-07-09 20:51:47 +08:00
committed by GitHub
parent 3d49271878
commit bc4ef2c028
18 changed files with 430 additions and 285 deletions

View File

@ -4,25 +4,28 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
devtool: false,
context: path.join(__dirname, '../packages/jsx-explorer'),
entry: './src/index.js',
entry: './src/index.ts',
output: {
publicPath: './',
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
compilerOptions: { downlevelIteration: true },
},
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: 'dist/fonts/[name].[hash:7].[ext]',
name: 'fonts/[name].[hash:7].[ext]',
},
},
{
@ -40,6 +43,9 @@ module.exports = {
filename: 'index.html',
}),
],
resolve: {
extensions: ['.ts', '.js'],
},
node: {
fs: 'empty',
},