# vue-strict

> Extract code from vue single file component

Latest version **1.0.0** (published 2022-01-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue-strict
pnpm add vue-strict
yarn add vue-strict
bun add vue-strict
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-01-15 |
| First published | 2018-10-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 65 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | berhalak |
| Maintainers | berhalak |
| Keywords | vue, typescript, components, vue-cli |

## Links

- npm: https://www.npmjs.com/package/vue-strict
- Repository: https://github.com/berhalak/vue-strict
- Homepage: https://github.com/berhalak/vue-strict#readme
- Issues: https://github.com/berhalak/vue-strict/issues
- npm.io page: https://npm.io/package/vue-strict

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.6.14
- [vue-router](https://npm.io/package/vue-router.md) ^3.5.3

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-01-15
- 0.0.23 — 2020-07-13
- 0.0.22 — 2020-07-05
- 0.0.21 — 2020-03-15
- 0.0.20 — 2020-03-10
- 0.0.19 — 2020-03-10
- 0.0.18 — 2020-03-02
- 0.0.17 — 2020-02-07
- 0.0.16 — 2020-02-07
- 0.0.15 — 2020-02-07
- 0.0.14 — 2020-01-13
- 0.0.13 — 2020-01-13
- 0.0.12 — 2020-01-12
- 0.0.11 — 2020-01-12
- 0.0.10 — 2019-07-14
- … 8 more at https://npm.io/package/vue-strict/versions

## README

# vue-strict

Simple plugin for vue (and vue-cli in progress).

It lets you extract script (in ts) from a vue single-file components, to a separate file written in typescript.

Before

    // component.vue
    <template>
	  <div>{{msg}} {{user}}</div>
	</template>
	<script>
	export default {
		props : ['user'],
		data() {
			return {
				msg : 'Hello world'
			}
		}
	}
	</script>

After (in 2 files)

    // component.vue
    <template>
	  <div>{{msg}} {{user}}</div>
	</template>

	// component.vue.ts
	import { ComponentBase, prop } from 'vue-strict'
	export default class extends ComponentBase {
		@prop
		public user : string;		
		private msg : string = "Hello world";
	}


How to install

	npm i vue-strict
	
Add modify your webpack config

1. Webpack template

	module: {
		rules: [
			{
				test: /\.vue$/,
				use: [{
					loader: 'vue-loader',
					options: vueLoaderConfig
				},{
					loader : 'vue-strict'
				}]
			},

2. Vue cli based projects, sample vue.config.js

	var path = require('path')

	module.exports = {
		chainWebpack: config => {
			config.module
				.rule('vue')
				.use('vue-strict')
				.loader('vue-strict');
		},

		baseUrl: undefined,
		outputDir: undefined,
		assetsDir: undefined,
		runtimeCompiler: true,
		productionSourceMap: undefined,
		parallel: undefined,
		css: undefined
	}

---
_Source: https://npm.io/package/vue-strict · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
