Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Edit webpack.config.js #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

var path = require('path')
var webpack = require('webpack')
const VueLoaderPlugin = require('vue-loader/lib/plugin')

module.exports = {
entry: './src/index.ts',
Expand All @@ -25,6 +26,21 @@ module.exports = {
// other vue-loader options go here
}
},
// this will apply to both plain `.js` files
// AND `<script>` blocks in `.vue` files
{
test: /\.js$/,
loader: 'babel-loader'
},
// this will apply to both plain `.css` files
// AND `<style>` blocks in `.vue` files
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
Expand All @@ -42,6 +58,9 @@ module.exports = {
}
]
},
plugins: [
new VueLoaderPlugin()
],
resolve: {
extensions: ['.ts', '.js', '.vue', '.json'],
alias: {
Expand Down Expand Up @@ -77,4 +96,4 @@ if (process.env.NODE_ENV === 'production') {
minimize: true
})
])
}
}