feat: rollup build, basic typescript support and typescript app

This commit is contained in:
pooya parsa 2020-07-17 17:13:04 +02:00
parent 00e13c3e41
commit e7dd27fa2a
20 changed files with 8 additions and 3 deletions

View File

@ -143,6 +143,8 @@ module.exports = (api, options = {}) => {
shippedProposals,
forceAllTransforms
}
], [
require('@babel/preset-typescript')
])
// JSX

View File

@ -0,0 +1,3 @@
export * from './core'
export const getBuilder = () => import('./builder')

View File

@ -217,7 +217,7 @@ export default class WebpackBaseConfig {
return {
resolve: {
extensions: ['.wasm', '.mjs', '.js', '.json', '.vue', '.jsx'],
extensions: ['.wasm', '.mjs', '.js', '.ts', '.json', '.vue', '.jsx', '.tsx'],
alias: this.alias(),
modules: webpackModulesDir
},

View File

@ -206,7 +206,7 @@ export default class WebpackClientConfig extends WebpackBaseConfig {
// Entry points
config.entry = Object.assign({}, config.entry, {
app: [path.resolve(buildDir, 'entry.client.js')]
app: [path.resolve(buildDir, 'entry.client.ts')]
})
// Add HMR support

View File

@ -114,7 +114,7 @@ export default class WebpackServerConfig extends WebpackBaseConfig {
target: 'node',
node: false,
entry: Object.assign({}, config.entry, {
app: [path.resolve(this.buildContext.options.buildDir, 'entry.server.js')]
app: [path.resolve(this.buildContext.options.buildDir, 'entry.server.ts')]
}),
output: Object.assign({}, config.output, {
filename: 'server.js',