mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-04 09:15:16 +00:00
fix: use webpack for package
This commit is contained in:
parent
4a3b60e601
commit
b350a882d6
@ -7,7 +7,8 @@
|
|||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rimraf lib && tsc",
|
"compile": "rimraf lib && tsc",
|
||||||
|
"build": "rimraf lib && webpack",
|
||||||
"demo": "ts-node -r tsconfig-paths/register ./src/demo/main.ts",
|
"demo": "ts-node -r tsconfig-paths/register ./src/demo/main.ts",
|
||||||
"test": "ava"
|
"test": "ava"
|
||||||
},
|
},
|
||||||
@ -19,8 +20,12 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ava": "^1.0.1",
|
"ava": "^1.0.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
"ts-loader": "^6.2.2",
|
||||||
"ts-node": "^7.0.1",
|
"ts-node": "^7.0.1",
|
||||||
"tsconfig-paths": "^3.9.0"
|
"tsconfig-paths": "^3.9.0",
|
||||||
|
"tsconfig-paths-webpack-plugin": "^3.2.0",
|
||||||
|
"webpack": "^4.42.1",
|
||||||
|
"webpack-cli": "^3.3.11"
|
||||||
},
|
},
|
||||||
"ava": {
|
"ava": {
|
||||||
"compileEnhancements": false,
|
"compileEnhancements": false,
|
||||||
|
|||||||
@ -1,15 +1,22 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"module": "es2015",
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"isolatedModules": true,
|
||||||
|
"target": "es5",
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"inlineSources": false,
|
||||||
|
"lib": ["es2015"],
|
||||||
|
"downlevelIteration": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": ["./src/*"]
|
||||||
},
|
},
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"lib": [
|
|
||||||
"es6"
|
|
||||||
],
|
|
||||||
"types": ["node"],
|
"types": ["node"],
|
||||||
"baseUrl": ".", /* Base directory to resolve non-absolute module names. */
|
"baseUrl": "." /* Base directory to resolve non-absolute module names. */
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*"
|
"src/**/*"
|
||||||
|
|||||||
29
packages/code-generator/webpack.config.js
Normal file
29
packages/code-generator/webpack.config.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
const path = require('path');
|
||||||
|
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
// entry: './src/index.ts',
|
||||||
|
target: 'node',
|
||||||
|
entry: {
|
||||||
|
index: './src/index.ts',
|
||||||
|
// demo: './src/demo/main.ts',
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.tsx?$/,
|
||||||
|
use: 'ts-loader',
|
||||||
|
exclude: /node_modules/,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: [ '.tsx', '.ts', '.js' ],
|
||||||
|
plugins: [new TsconfigPathsPlugin({/* options: see below */})],
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
// filename: 'bundle.js',
|
||||||
|
filename: '[name].js',
|
||||||
|
path: path.resolve(__dirname, 'lib'),
|
||||||
|
},
|
||||||
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user