QingWei-Li / vue-markdown-loader

📇 Convert Markdown file to Vue2.0 component.
704 stars 161 forks source link

[issue] Script tag cause error in production environment #55

Closed chiaweilee closed 5 years ago

chiaweilee commented 5 years ago
webpackConfig.module
      .rule('md')
      .test(/\.md$/)
      .use('vue-loader')
      .loader('vue-loader')
      .end()
      .use('vue-markdown-loader')
      .loader('vue-markdown-loader/lib/markdown-compiler')
      .options({
          raw: true
       })
# TEST
<script>console.log(111)</script>

In development environment

Everything fine.

in production environment

Module build failed (from ./node_modules/_thread-loader@1.2.0@thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
Cannot read property '__vueMarkdownOptions__' of undefined

    at Object.module.exports (/Users/jv/Desktop/project/vue-markdown-docs/node_modules/_vue-markdown-loader@2.4.1@vue-markdown-loader/lib/markdown-compiler.js:67:46)
Remove Script tag
build success..
ideagay commented 5 years ago

如果想保留script标签呢,在生产环境打包的出错的这个问题怎么解决