{"action":"closed","issue":{"url":"https://api.github.com/repos/WearyMonkey/ngtemplate-loader/issues/34","repository_url":"https://api.github.com/repos/WearyMonkey/ngtemplate-loader","labels_url":"https://api.github.com/repos/WearyMonkey/ngtemplate-loader/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/WearyMonkey/ngtemplate-loader/issues/34/comments","events_url":"https://api.github.com/repos/WearyMonkey/ngtemplate-loader/issues/34/events","html_url":"https://github.com/WearyMonkey/ngtemplate-loader/issues/34","id":133805216,"number":34,"title":"rendered content has module.exports in output","user":{"login":"dagda1","id":118328,"avatar_url":"https://avatars.githubusercontent.com/u/118328?v=3","gravatar_id":"","url":"https://api.github.com/users/dagda1","html_url":"https://github.com/dagda1","followers_url":"https://api.github.com/users/dagda1/followers","following_url":"https://api.github.com/users/dagda1/following{/other_user}","gists_url":"https://api.github.com/users/dagda1/gists{/gist_id}","starred_url":"https://api.github.com/users/dagda1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagda1/subscriptions","organizations_url":"https://api.github.com/users/dagda1/orgs","repos_url":"https://api.github.com/users/dagda1/repos","events_url":"https://api.github.com/users/dagda1/events{/privacy}","received_events_url":"https://api.github.com/users/dagda1/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-02-15T20:10:41Z","updated_at":"2016-08-01T14:09:26Z","closed_at":"2016-08-01T14:09:26Z","body":"My rendered output looks like this:\r\n\r\n![exports](https://cloud.githubusercontent.com/assets/118328/13059095/c21090f8-d41f-11e5-88b8-d1ac16fc8354.png)\r\n\r\nI am using angular 1.5 and I am creating components like this:\r\n```\r\nimport angular from 'angular';\r\n\r\nconst templateUrl = require('ngtemplate!html!./home.html');\r\n\r\nangular.module('app.components', [])\r\n  .component('home', {\r\n    templateUrl: templateUrl\r\n  });\r\n```\r\n\r\nAnd my webpack.config.js looks like this:\r\n\r\n```\r\n'use strict';\r\n\r\n// Modules\r\nvar webpack = require('webpack');\r\nvar autoprefixer = require('autoprefixer');\r\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\r\nvar ExtractTextPlugin = require('extract-text-webpack-plugin');\r\nvar CopyWebpackPlugin = require('copy-webpack-plugin');\r\n\r\nmodule.exports = function makeWebpackConfig (ENV) {\r\n  /**\r\n   * Config\r\n   * Reference: http://webpack.github.io/docs/configuration.html\r\n   * This is the object where all configuration gets set\r\n   */\r\n  var config = {};\r\n\r\n  /**\r\n   * Entry\r\n   * Reference: http://webpack.github.io/docs/configuration.html#entry\r\n   * Should be an empty object if it's generating a test build\r\n   * Karma will set this when it's a test build\r\n   */\r\n  config.entry = ENV === 'test' ? {} : {\r\n    app: './src/app/app.js'\r\n  };\r\n\r\n  /**\r\n   * Output\r\n   * Reference: http://webpack.github.io/docs/configuration.html#output\r\n   * Should be an empty object if it's generating a test build\r\n   * Karma will handle setting it up for you when it's a test build\r\n   */\r\n  config.output = ENV === 'test' ? {} : {\r\n    // Absolute output directory\r\n    path: __dirname + '/dist',\r\n\r\n    // Output path from the view of the page\r\n    // Uses webpack-dev-server in development\r\n    publicPath: ENV === 'prod' ? '/' : 'http://localhost:8080/',\r\n\r\n    // Filename for entry points\r\n    // Only adds hash in build mode\r\n    filename: ENV === 'prod' ? '[name].[hash].js' : '[name].bundle.js',\r\n\r\n    // Filename for non-entry points\r\n    // Only adds hash in build mode\r\n    chunkFilename: ENV === 'prod' ? '[name].[hash].js' : '[name].bundle.js'\r\n  };\r\n\r\n  /**\r\n   * Devtool\r\n   * Reference: http://webpack.github.io/docs/configuration.html#devtool\r\n   * Type of sourcemap to use per build type\r\n   */\r\n  if (ENV === 'test') {\r\n    config.devtool = 'inline-source-map';\r\n  } else if (ENV === 'prod') {\r\n    config.devtool = 'source-map';\r\n  } else {\r\n    config.devtool = 'eval-source-map';\r\n  }\r\n\r\n  /**\r\n   * Loaders\r\n   * Reference: http://webpack.github.io/docs/configuration.html#module-loaders\r\n   * List: http://webpack.github.io/docs/list-of-loaders.html\r\n   * This handles most of the magic responsible for converting modules\r\n   */\r\n\r\n  // Initialize module\r\n  config.module = {\r\n    preLoaders: [],\r\n    loaders: [{\r\n      // JS LOADER\r\n      // Reference: https://github.com/babel/babel-loader\r\n      // Transpile .js files using babel-loader\r\n      // Compiles ES6 and ES7 into ES5 code\r\n      test: /\\.js$/,\r\n      loader: 'babel',\r\n      exclude: /node_modules/\r\n    }, {\r\n      // CSS LOADER\r\n      // Reference: https://github.com/webpack/css-loader\r\n      // Allow loading css through js\r\n      //\r\n      // Reference: https://github.com/postcss/postcss-loader\r\n      // Postprocess your css with PostCSS plugins\r\n      test: /\\.css$/,\r\n      // Reference: https://github.com/webpack/extract-text-webpack-plugin\r\n      // Extract css files in production builds\r\n      //\r\n      // Reference: https://github.com/webpack/style-loader\r\n      // Use style-loader in development.\r\n      loader: ENV === 'test' ? 'null' : ExtractTextPlugin.extract('style', 'css?sourceMap!postcss')\r\n    }, {\r\n      // ASSET LOADER\r\n      // Reference: https://github.com/webpack/file-loader\r\n      // Copy png, jpg, jpeg, gif, svg, woff, woff2, ttf, eot files to output\r\n      // Rename the file using the asset hash\r\n      // Pass along the updated reference to your code\r\n      // You can add here any file extension you want to get copied to your output\r\n      test: /\\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)$/,\r\n      loader: 'file'\r\n    }, {\r\n      // HTML LOADER\r\n      // Reference: https://github.com/webpack/raw-loader\r\n      // Allow loading html through js\r\n      test: /\\.html$/,\r\n      loader: 'raw'\r\n    }]\r\n  };\r\n\r\n  // ISPARTA LOADER\r\n  // Reference: https://github.com/ColCh/isparta-instrumenter-loader\r\n  // Instrument JS files with Isparta for subsequent code coverage reporting\r\n  // Skips node_modules and files that end with .test.js\r\n  if (ENV === 'test') {\r\n    config.module.preLoaders.push({\r\n      test: /\\.js$/,\r\n      exclude: [\r\n        /node_modules/,\r\n        /\\.spec\\.js$/\r\n      ],\r\n      loader: 'isparta-instrumenter'\r\n    })\r\n  }\r\n\r\n  /**\r\n   * PostCSS\r\n   * Reference: https://github.com/postcss/autoprefixer-core\r\n   * Add vendor prefixes to your css\r\n   */\r\n  config.postcss = [\r\n    autoprefixer({\r\n      browsers: ['last 2 version']\r\n    })\r\n  ];\r\n\r\n  /**\r\n   * Plugins\r\n   * Reference: http://webpack.github.io/docs/configuration.html#plugins\r\n   * List: http://webpack.github.io/docs/list-of-plugins.html\r\n   */\r\n  config.plugins = [];\r\n\r\n  // Skip rendering index.html in test mode\r\n  if (ENV !== 'test') {\r\n    // Reference: https://github.com/ampedandwired/html-webpack-plugin\r\n    // Render index.html\r\n    config.plugins.push(\r\n      new HtmlWebpackPlugin({\r\n        template: './src/public/index.html',\r\n        inject: 'body'\r\n      }),\r\n\r\n      // Reference: https://github.com/webpack/extract-text-webpack-plugin\r\n      // Extract css files\r\n      // Disabled when in test mode or not in build mode\r\n      new ExtractTextPlugin('[name].[hash].css', {disable: ENV !== 'prod'})\r\n    )\r\n  }\r\n\r\n  // Add build specific plugins\r\n  if (ENV === 'prod') {\r\n    config.plugins.push(\r\n      // Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin\r\n      // Only emit files when there are no errors\r\n      new webpack.NoErrorsPlugin(),\r\n\r\n      // Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin\r\n      // Dedupe modules in the output\r\n      new webpack.optimize.DedupePlugin(),\r\n\r\n      // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin\r\n      // Minify all javascript, switch loaders to minimizing mode\r\n      new webpack.optimize.UglifyJsPlugin(),\r\n\r\n      // Copy assets from the public folder\r\n      // Reference: https://github.com/kevlened/copy-webpack-plugin\r\n      new CopyWebpackPlugin([{\r\n        from: __dirname + '/src/public'\r\n      }])\r\n    )\r\n  }\r\n\r\n  /**\r\n   * Dev server configuration\r\n   * Reference: http://webpack.github.io/docs/configuration.html#devserver\r\n   * Reference: http://webpack.github.io/docs/webpack-dev-server.html\r\n   */\r\n  config.devServer = {\r\n    contentBase: './src/public',\r\n    stats: {\r\n      modules: false,\r\n      cached: false,\r\n      colors: true,\r\n      chunk: false\r\n    }\r\n  };\r\n\r\n  return config;\r\n}();\r\n```\r\n"}}
{"actor":{"display_login":"WearyMonkey"}}