Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const path = require('path');
- module.exports = {
- mode: 'development',
- entry: {
- main: path.resolve(__dirname, 'src', 'main', 'index.ts'),
- html: path.resolve(__dirname, 'src', 'res', 'html', 'index.ts')
- },
- module: {
- rules: [
- {
- test: /.ts$/,
- use: 'ts-loader',
- exclude: /node_modules/,
- options: {
- configFile: 'src/tsconfig.json',
- }
- },
- {
- test: /.html$/,
- loader: 'file-loader',
- include: path.resolve(__dirname, 'src', 'res', 'html'),
- exclude: /node_modules/,
- options: {
- name: '[name].[ext]',
- outputPath: 'examples',
- }
- }
- ]
- },
- resolve: {
- extensions: [ '.ts', '.html', '.js' ]
- },
- output: {
- filename: '[name].js',
- path: path.resolve(__dirname, 'dist')
- }
- };
- {
- "compilerOptions": {
- "outDir": "../dist/",
- "noImplicitAny": true,
- "module": "commonjs",
- "target": "es5",
- "allowJs": false,
- "moduleResolution": "node",
- "lib": ["es6", "dom"],
- "typeRoots": [ "../node_modules/@types", "../types"],
- },
- "include": [
- "main/**/*",
- "res/html/**/*"
- ],
- "exclude": []
- }
- declare module '*.html' {
- const value: string;
- export default value
- }
- import test from './test'
- import file from './file.html'
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title>FILE</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- </head>
- <body>
- <h1>hello world</h1>
- </body>
- </html>
Add Comment
Please, Sign In to add comment