2.0.0 • Published 2 years ago

in-loader v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

install npm install -D in-loader

javascript

<in>./src/a.js</in>
export default "hello world!"

You can also use it for other file,for example:xxx.vue

x.vue

<template>
  <div>
    <in>./src/tpl/a.tpl</in>
  </div>
</template>
<script></script>
<style></style>

./src/tpl/a.tpl

<ul>
  <li>item1</li>
  <li>item2</li>
  <li>item3</li>
  <li>item4</li>
  <li>item5</li>
  <li>item6</li>
  <li>item7</li>
  <li>item8</li>
</ul>

webpack.config.js

module: {
  rules: [
    ...
    {
      test: /\.js$/,
      use: ['babel-loader','in-loader']
    },
    {
      test: /\.vue$/,
      use: ['vue-loader','in-loader']
    }
    ...
  ]
}

if you want to use some other tag instead of ,you can use option tag; webpack.config.js

module: {
  rules: [
    ...
    {
      test: /\.js$/,
      use: ['babel-loader',{
        loader:'in-loader',
        option:{
          tag:'aaa'
        }
      }]
    }
    ...
  ]
}

javascript

<aaa>./src/a.js</aaa>
export default "hello world!"
2.0.0

2 years ago

1.1.0

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago