Skip to content

Instantly share code, notes, and snippets.

@sofyan-ahmad
Created July 18, 2018 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sofyan-ahmad/eacfa311d330f321ef501c569a3d73d4 to your computer and use it in GitHub Desktop.
Save sofyan-ahmad/eacfa311d330f321ef501c569a3d73d4 to your computer and use it in GitHub Desktop.
poi.config.ts sample !!FOR EXPERIMENTAL ONLY!!
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