Skip to content

Commit 1e1ef7e

Browse files
wip(core): vue2 support
1 parent 57b33bc commit 1e1ef7e

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

build/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = (env = {}, { mode = 'production' }) => {
3131

3232
const genSourcemap = false;
3333

34-
console.log('config', { targetsBrowsers, noPresetEnv, noCompress, genSourcemap });
34+
console.log('config', { targetsBrowsers, noPresetEnv, noCompress, genSourcemap, vueVersion });
3535

3636
return {
3737
entry: [

src/createVue2SFCModule.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
3+
4+
import {
5+
parse as babel_parse,
6+
ParserPlugin as babel_ParserPlugin
7+
} from '@babel/parser';
8+
9+
import {
10+
transformFromAstAsync as babel_transformFromAstAsync,
11+
types as t,
12+
} from '@babel/core';
13+
14+
// @ts-ignore (Could not find a declaration file for module '@babel/plugin-transform-modules-commonjs')
15+
import babelPluginTransformModulesCommonjs from '@babel/plugin-transform-modules-commonjs'
16+
17+
18+
import { formatError, withCache, hash, renameDynamicImport, parseDeps, interopRequireDefault, transformJSCode, loadDeps, createModule } from './tools.ts'
19+
20+
import { Options, LoadModule, ModuleExport, CustomBlockCallback } from './types.ts'
21+
22+
23+
24+
25+
26+
/**
27+
* the version of the library (process.env.VERSION is set by webpack, at compile-time)
28+
*/
29+
const version : string = process.env.VERSION;
30+
31+
const genSourcemap : boolean = !!process.env.GEN_SOURCEMAP;
32+
33+
/**
34+
* @internal
35+
*/
36+
const isProd : boolean = process.env.NODE_ENV === 'production';
37+
38+
39+
40+
/**
41+
* @internal
42+
*/
43+
44+
export async function createSFCModule(source : string, filename : string, options : Options, loadModule : LoadModule) : Promise<ModuleExport> {
45+
46+
const component = {};
47+
48+
49+
const { delimiters, moduleCache, compiledCache, addStyle, log, additionalBabelPlugins = [], customBlockHandler } = options;
50+
51+
52+
return component;
53+
}

0 commit comments

Comments
 (0)