Created
October 1, 2019 19:13
-
-
Save yaakaito/a49bd506e49c644c3d5d3baefc7ac839 to your computer and use it in GitHub Desktop.
適当にデモ用の最小構成
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
const path = require('path') | |
const HtmlWebpackPlugin = require('html-webpack-plugin') | |
module.exports = (env = {}) => { | |
return { | |
mode: 'development', | |
entry: { | |
index: path.resolve(__dirname, 'src/index.ts') | |
}, | |
output: { | |
filename: '[name]-[contenthash].js', | |
path: path.resolve(__dirname, 'dist'), | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
chunks: ['index'], | |
filename: 'index.html', | |
template: path.resolve(__dirname, 'src/index.html') | |
}) | |
], | |
devServer: { | |
contentBase: path.resolve(__dirname, './dist'), | |
port: 9000, | |
}, | |
resolve: { | |
extensions: ['.js', '.ts'], | |
modules: [ | |
"node_modules" | |
] | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.ts$/, | |
use: [ | |
{ | |
loader: 'ts-loader', | |
options: { | |
appendTsSuffixTo: [/\.vue$/], | |
}, | |
}, | |
], | |
exclude: /node_modules/, | |
}, | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment