Created
July 18, 2018 11:26
-
-
Save sofyan-ahmad/eacfa311d330f321ef501c569a3d73d4 to your computer and use it in GitHub Desktop.
poi.config.ts sample !!FOR EXPERIMENTAL ONLY!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Options } from 'poi'; | |
import * as VueLoaderPlugin from 'vue-loader/lib/plugin'; | |
const options: Options = { | |
entry: './src/main.ts', | |
html: { | |
title: 'Vuex with TypeScript example', | |
template: './index.html', | |
}, | |
homepage: '.', | |
transformModules: ['natural'], | |
node: { | |
fs: 'empty', | |
child_process: 'empty', | |
}, | |
module: { | |
plugins: [ | |
// make sure to include the plugin! | |
new VueLoaderPlugin(), | |
], | |
rules: [ | |
{ | |
test: /\.vue$/, | |
loader: 'vue-loader', | |
options: { | |
loaders: { | |
// Since sass-loader (weirdly) has SCSS as its default parse mode, we map | |
// the "scss" and "sass" values for the lang attribute to the right configs here. | |
// other preprocessors should work out of the box, no loader config like this necessary. | |
scss: 'vue-style-loader!css-loader!sass-loader', | |
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax', | |
}, | |
// other vue-loader options go here | |
}, | |
}, | |
{ | |
test: /\.pug$/, | |
loader: 'pug-plain-loader', | |
}, | |
{ | |
test: /\.styl$/, | |
loader: 'style-loader!css-loader!stylus-loader', | |
}, | |
{ | |
test: /\.tsx?$/, | |
loader: 'ts-loader', | |
exclude: /node_modules/, | |
options: { | |
appendTsSuffixTo: [/\.vue$/], | |
}, | |
}, | |
{ | |
test: /\.(png|jpg|gif|svg)$/, | |
loader: 'file-loader', | |
options: { | |
name: '[name].[ext]?[hash]', | |
}, | |
}, | |
{ | |
test: /\.css$/, | |
use: ['vue-style-loader', 'css-loader'], | |
}, | |
], | |
}, | |
resolve: { | |
extensions: ['.ts', '.js', '.vue', '.json'], | |
alias: { | |
vue$: 'vue/dist/vue.esm.js', | |
}, | |
}, | |
devServer: { | |
historyApiFallback: true, | |
noInfo: true, | |
}, | |
performance: { | |
hints: false, | |
}, | |
devtool: '#eval-source-map', | |
}; | |
export default options; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment