小编Sye*_*aqi的帖子

使用Webpack导入CSS和JS文件

我有这样的目录结构:

在此输入图像描述

和node_modules内:

 >node_modules
  >./bin
   >webpack.config.js
  >bootstrap
   >bootstrap.css
   >bootstrap.js
Run Code Online (Sandbox Code Playgroud)

我需要像这样生成单独的CSS和JS包:

custom-styles.css,custom-js.js,style-libs.css,js-libs.js

where style-libsjs-libsshould应该包含所有库的syles和js文件,如bootstrap和jQuery.这是我到目前为止所做的:

webpack.config.js:

const path = require('path');
const basedir = path.join(__dirname, '../../client');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const stylesPath = path.join(__dirname, '../bootstrap/dist/css');

var ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
  watch: true,

  // Script to bundle using webpack
  entry: path.join(basedir, 'src', 'Client.js'),
  // Output directory and bundled file
  output: {
    path: path.join(basedir, 'dist'),
    filename: 'app.js'
  },
  // Configure module loaders (for JS ES6, JSX, etc.)
  module: {
    // Babel …
Run Code Online (Sandbox Code Playgroud)

reactjs webpack webpack-style-loader html-webpack-plugin

12
推荐指数
2
解决办法
3万
查看次数

平台设置后无法启用prod模式.Angular 5 Production build

错误:

Uncaught Error: Cannot enable prod mode after platform setup. at main.bundle.js:1 
Run Code Online (Sandbox Code Playgroud)

案件:

在使用生成构建之后,应用程序启动时出错ng build --prod.但是,使用ng serve或编译的开发构建ng build工作正常.

我尝试了什么:

- 升级全局和本地@angular/cli到最新版本,即1.6.0遵循答案.

的package.json:

{
  "dependencies": {
    "@angular/animations": "^5.0.0",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
    "auth0-js": "^8.11.3",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "jquery": "^3.2.1",
    "rxjs": "^5.5.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.0",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/language-service": "^5.0.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2", …
Run Code Online (Sandbox Code Playgroud)

typescript webpack angular-cli angular angular5

6
推荐指数
1
解决办法
3902
查看次数

使用适用于 Office 的 JavaScript API 获取邮件正文

我正在开发一个简单的邮件应用程序,我需要获取消息正文。MSDN说,Office JavaScript API 1.1版本有对象属性,可以这样获取:bodymessage

Office.context.mailbox.item.body;
Run Code Online (Sandbox Code Playgroud)

但问题是我需要访问bodyinread mode和 MSDN 声明:

读取模式: body 属性未定义。

body该财产为什么undefinedread mode以及我如何访问它?(如果可能的话)

outlook-addin javascript-api-for-office office-js

5
推荐指数
1
解决办法
4626
查看次数

如何在.net core 2中动态创建sitemap.xml?

谁能告诉我如何在.net core 2中创建站点地图?此文章 / 备用链路在芯2不工作。

sitemap asp.net asp.net-core .net-core-2.0

4
推荐指数
4
解决办法
4816
查看次数