Guest User

Untitled

a guest
May 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. const path = require('path');
  2.  
  3. module.exports = {
  4. mode: 'development',
  5. entry: {
  6. main: path.resolve(__dirname, 'src', 'main', 'index.ts'),
  7. html: path.resolve(__dirname, 'src', 'res', 'html', 'index.ts')
  8. },
  9. module: {
  10. rules: [
  11. {
  12. test: /.ts$/,
  13. use: 'ts-loader',
  14. exclude: /node_modules/,
  15. options: {
  16. configFile: 'src/tsconfig.json',
  17. }
  18. },
  19. {
  20. test: /.html$/,
  21. loader: 'file-loader',
  22. include: path.resolve(__dirname, 'src', 'res', 'html'),
  23. exclude: /node_modules/,
  24. options: {
  25. name: '[name].[ext]',
  26. outputPath: 'examples',
  27. }
  28. }
  29. ]
  30. },
  31. resolve: {
  32. extensions: [ '.ts', '.html', '.js' ]
  33. },
  34. output: {
  35. filename: '[name].js',
  36. path: path.resolve(__dirname, 'dist')
  37. }
  38. };
  39.  
  40. {
  41. "compilerOptions": {
  42. "outDir": "../dist/",
  43. "noImplicitAny": true,
  44. "module": "commonjs",
  45. "target": "es5",
  46. "allowJs": false,
  47. "moduleResolution": "node",
  48. "lib": ["es6", "dom"],
  49. "typeRoots": [ "../node_modules/@types", "../types"],
  50. },
  51. "include": [
  52. "main/**/*",
  53. "res/html/**/*"
  54. ],
  55. "exclude": []
  56. }
  57.  
  58. declare module '*.html' {
  59. const value: string;
  60. export default value
  61. }
  62.  
  63. import test from './test'
  64. import file from './file.html'
  65.  
  66. <!DOCTYPE html>
  67. <html>
  68. <head>
  69. <meta charset="utf-8" />
  70. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  71. <title>FILE</title>
  72. <meta name="viewport" content="width=device-width, initial-scale=1">
  73. </head>
  74. <body>
  75. <h1>hello world</h1>
  76. </body>
  77. </html>
Add Comment
Please, Sign In to add comment