Skip to content

xxxxst/example-tsunit

Repository files navigation

example-tsunit

tsunit example with webpack + typescript + vue

Compile

  • download source code
  • cd "yourPath/example-tsunit/"
  • npm install
  • npm run dev

construction

example-tsunit/
|- /src/
   |- components
      |- Aaa.vue       // component need to test
   |- /test/
      |- test.ts       // test entry
      |- BllTest.ts    // one test file
      |- TestView.vue  // ui test file
   |- App.vue          // index main components
   |- MainHome.ts      // index page entry
|- /vbuild/            // webpack config file
|- index.html          // main page
|- test.html           // test page
...

config

tsconfig.json

{
    "compilerOptions": {
        "sourceMap": true,
        "experimentalDecorators": true,
    }
    ...
}

webpack dev config

ignore the config in production mode

{
    entry: {
        test: "./src/test/test.ts",
    },
    plugins: [
        new HtmlWebpackPlugin({
            filename: path.resolve(__dirname, "../dist/web/test.html"),
            template: "test.html",
            inject: true,
            chunks: ['manifest', 'polyfill', 'vendors', 'test']
        })
    ]
    ...
}

About

example of tsunit library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published