UNPKG

996 BJavaScriptView Raw
1const path = require('path')
2const HtmlWebpackPlugin = require('html-webpack-plugin')
3
4module.exports = {
5 mode: 'development',
6 devServer: {
7 contentBase: [path.join(__dirname, 'example'), path.join(__dirname, 'codemirror'), path.join(__dirname, 'dist')],
8 compress: true,
9 port: 9000,
10 publicPath: '/dist'
11 },
12 entry: './src/nft-card.ts',
13 output: {
14 filename: 'nft-card.min.js',
15 path: path.resolve(__dirname, 'dist'),
16 publicPath: '/'
17 },
18 resolve: {
19 extensions: ['.js', '.ts', '.css']
20 },
21 plugins: [
22 new HtmlWebpackPlugin({
23 template: path.resolve(__dirname, 'example/index.html')
24 })
25 ],
26 module: {
27 rules: [
28 {
29 test: /\.tsx?$/,
30 use: 'ts-loader',
31 exclude: /node_modules/
32 },
33 {
34 test: /\.css$/i,
35 use: ['style-loader', 'css-loader']
36 },
37 {
38 test: /\.(woff2|png)$/i,
39 use: [
40 {
41 loader: 'url-loader'
42 }
43 ]
44 }
45 ]
46 }
47}